code
stringlengths
2.5k
150k
kind
stringclasses
1 value
rust Function std::io::copy Function std::io::copy ====================== ``` pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> Result<u64>where    R: Read,    W: Write, ``` Copies the entire contents of a reader into a writer. This function will continuously read data from `reader` and then write it into `writer` in a streaming fashion until `reader` returns EOF. On success, the total number of bytes that were copied from `reader` to `writer` is returned. If you’re wanting to copy the contents of one file to another and you’re working with filesystem paths, see the [`fs::copy`](../fs/fn.copy) function. Errors ------ This function will return an error immediately if any call to [`read`](trait.read#tymethod.read) or [`write`](trait.write#tymethod.write) returns an error. All instances of [`ErrorKind::Interrupted`](enum.errorkind#variant.Interrupted "ErrorKind::Interrupted") are handled by this function and the underlying operation is retried. Examples -------- ``` use std::io; fn main() -> io::Result<()> { let mut reader: &[u8] = b"hello"; let mut writer: Vec<u8> = vec![]; io::copy(&mut reader, &mut writer)?; assert_eq!(&b"hello"[..], &writer[..]); Ok(()) } ``` Platform-specific behavior -------------------------- On Linux (including Android), this function uses `copy_file_range(2)`, `sendfile(2)` or `splice(2)` syscalls to move data directly between file descriptors if possible. Note that platform-specific behavior [may change in the future](index#platform-specific-behavior). rust Struct std::io::WriterPanicked Struct std::io::WriterPanicked ============================== ``` pub struct WriterPanicked { /* private fields */ } ``` Error returned for the buffered data from `BufWriter::into_parts`, when the underlying writer has previously panicked. Contains the (possibly partly written) buffered data. Example ------- ``` use std::io::{self, BufWriter, Write}; use std::panic::{catch_unwind, AssertUnwindSafe}; struct PanickingWriter; impl Write for PanickingWriter { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { panic!() } fn flush(&mut self) -> io::Result<()> { panic!() } } let mut stream = BufWriter::new(PanickingWriter); write!(stream, "some data").unwrap(); let result = catch_unwind(AssertUnwindSafe(|| { stream.flush().unwrap() })); assert!(result.is_err()); let (recovered_writer, buffered_data) = stream.into_parts(); assert!(matches!(recovered_writer, PanickingWriter)); assert_eq!(buffered_data.unwrap_err().into_inner(), b"some data"); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#476-487)### impl WriterPanicked [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#481-483)#### pub fn into\_inner(self) -> Vec<u8> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Returns the perhaps-unwritten data. Some of this data may have been written by the panicking call(s) to the underlying writer, so simply writing it again is not a good idea. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#505-511)### impl Debug for WriterPanicked [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#506-510)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#498-502)### impl Display for WriterPanicked [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#499-501)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#490-495)### impl Error for WriterPanicked [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#492-494)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for WriterPanicked ### impl Send for WriterPanicked ### impl Sync for WriterPanicked ### impl Unpin for WriterPanicked ### impl UnwindSafe for WriterPanicked Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Type Definition std::io::Result Type Definition std::io::Result =============================== ``` pub type Result<T> = Result<T, Error>; ``` A specialized [`Result`](../result/enum.result) type for I/O operations. This type is broadly used across [`std::io`](index) for any operation which may produce an error. This typedef is generally used to avoid writing out [`io::Error`](struct.error) directly and is otherwise a direct mapping to [`Result`](../result/enum.result). While usual Rust style is to import types directly, aliases of [`Result`](../result/enum.result) often are not, to make it easier to distinguish between them. [`Result`](../result/enum.result) is generally assumed to be [`std::result::Result`](../result/enum.result), and so users of this alias will generally use `io::Result` instead of shadowing the [prelude](../prelude/index)’s import of [`std::result::Result`](../result/enum.result). Examples -------- A convenience function that bubbles an `io::Result` to its caller: ``` use std::io; fn get_string() -> io::Result<String> { let mut buffer = String::new(); io::stdin().read_line(&mut buffer)?; Ok(buffer) } ``` rust Struct std::io::Cursor Struct std::io::Cursor ====================== ``` pub struct Cursor<T> { /* private fields */ } ``` A `Cursor` wraps an in-memory buffer and provides it with a [`Seek`](trait.seek "Seek") implementation. `Cursor`s are used with in-memory buffers, anything implementing `[AsRef](../convert/trait.asref "AsRef")<[u8]>`, to allow them to implement [`Read`](trait.read "Read") and/or [`Write`](trait.write "Write"), allowing these buffers to be used anywhere you might use a reader or writer that does actual I/O. The standard library implements some I/O traits on various types which are commonly used as a buffer, like `Cursor<[Vec](../vec/struct.vec "Vec")<u8>>` and `Cursor<[&[u8]](../slice/index "slice")>`. Examples -------- We may want to write bytes to a [`File`](../fs/struct.file) in our production code, but use an in-memory buffer in our tests. We can do this with `Cursor`: ``` use std::io::prelude::*; use std::io::{self, SeekFrom}; use std::fs::File; // a library function we've written fn write_ten_bytes_at_end<W: Write + Seek>(writer: &mut W) -> io::Result<()> { writer.seek(SeekFrom::End(-10))?; for i in 0..10 { writer.write(&[i])?; } // all went well Ok(()) } // Here's some code that uses this library function. // // We might want to use a BufReader here for efficiency, but let's // keep this example focused. let mut file = File::create("foo.txt")?; write_ten_bytes_at_end(&mut file)?; // now let's write a test #[test] fn test_writes_bytes() { // setting up a real File is much slower than an in-memory buffer, // let's use a cursor instead use std::io::Cursor; let mut buff = Cursor::new(vec![0; 15]); write_ten_bytes_at_end(&mut buff).unwrap(); assert_eq!(&buff.get_ref()[5..15], &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); } ``` Implementations --------------- [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#79-205)### impl<T> Cursor<T> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#97-99)const: [unstable](https://github.com/rust-lang/rust/issues/78812 "Tracking issue for const_io_structs") · #### pub fn new(inner: T) -> Cursor<T> Notable traits for [Cursor](struct.cursor "struct std::io::Cursor")<T> ``` impl<T> Read for Cursor<T>where     T: AsRef<[u8]>, impl Write for Cursor<&mut [u8]> impl<A> Write for Cursor<&mut Vec<u8, A>>where     A: Allocator, impl<A> Write for Cursor<Vec<u8, A>>where     A: Allocator, impl<A> Write for Cursor<Box<[u8], A>>where     A: Allocator, impl<const N: usize> Write for Cursor<[u8; N]> ``` Creates a new cursor wrapping the provided underlying in-memory buffer. Cursor initial position is `0` even if underlying buffer (e.g., [`Vec`](../vec/struct.vec "Vec")) is not empty. So writing to cursor starts with overwriting [`Vec`](../vec/struct.vec "Vec") content, not with appending to it. ##### Examples ``` use std::io::Cursor; let buff = Cursor::new(Vec::new()); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#115-117)#### pub fn into\_inner(self) -> T Consumes this cursor, returning the underlying value. ##### Examples ``` use std::io::Cursor; let buff = Cursor::new(Vec::new()); let vec = buff.into_inner(); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#134-136)const: [unstable](https://github.com/rust-lang/rust/issues/78812 "Tracking issue for const_io_structs") · #### pub fn get\_ref(&self) -> &T Gets a reference to the underlying value in this cursor. ##### Examples ``` use std::io::Cursor; let buff = Cursor::new(Vec::new()); let reference = buff.get_ref(); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#155-157)#### pub fn get\_mut(&mut self) -> &mut T Gets a mutable reference to the underlying value in this cursor. Care should be taken to avoid modifying the internal I/O state of the underlying value as it may corrupt this cursor’s position. ##### Examples ``` use std::io::Cursor; let mut buff = Cursor::new(Vec::new()); let reference = buff.get_mut(); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#180-182)const: [unstable](https://github.com/rust-lang/rust/issues/78812 "Tracking issue for const_io_structs") · #### pub fn position(&self) -> u64 Returns the current position of this cursor. ##### Examples ``` use std::io::Cursor; use std::io::prelude::*; use std::io::SeekFrom; let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]); assert_eq!(buff.position(), 0); buff.seek(SeekFrom::Current(2)).unwrap(); assert_eq!(buff.position(), 2); buff.seek(SeekFrom::Current(-1)).unwrap(); assert_eq!(buff.position(), 1); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#202-204)#### pub fn set\_position(&mut self, pos: u64) Sets the position of this cursor. ##### Examples ``` use std::io::Cursor; let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]); assert_eq!(buff.position(), 0); buff.set_position(2); assert_eq!(buff.position(), 2); buff.set_position(4); assert_eq!(buff.position(), 4); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#207-261)### impl<T> Cursor<T>where T: [AsRef](../convert/trait.asref "trait std::convert::AsRef")<[[u8](../primitive.u8)]>, [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#233-236)#### pub fn remaining\_slice(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`cursor_remaining` [#86369](https://github.com/rust-lang/rust/issues/86369)) Returns the remaining slice. ##### Examples ``` #![feature(cursor_remaining)] use std::io::Cursor; let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]); assert_eq!(buff.remaining_slice(), &[1, 2, 3, 4, 5]); buff.set_position(2); assert_eq!(buff.remaining_slice(), &[3, 4, 5]); buff.set_position(4); assert_eq!(buff.remaining_slice(), &[5]); buff.set_position(6); assert_eq!(buff.remaining_slice(), &[]); ``` [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#258-260)#### pub fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`cursor_remaining` [#86369](https://github.com/rust-lang/rust/issues/86369)) Returns `true` if the remaining slice is empty. ##### Examples ``` #![feature(cursor_remaining)] use std::io::Cursor; let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]); buff.set_position(2); assert!(!buff.is_empty()); buff.set_position(5); assert!(buff.is_empty()); buff.set_position(10); assert!(buff.is_empty()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#361-371)### impl<T> BufRead for Cursor<T>where T: [AsRef](../convert/trait.asref "trait std::convert::AsRef")<[[u8](../primitive.u8)]>, [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#365-367)#### fn fill\_buf(&mut self) -> Result<&[u8]> Returns the contents of the internal buffer, filling it with more data from the inner reader if it is empty. [Read more](trait.bufread#tymethod.fill_buf) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#368-370)#### fn consume(&mut self, amt: usize) Tells this buffer that `amt` bytes have been consumed from the buffer, so they should no longer be returned in calls to `read`. [Read more](trait.bufread#tymethod.consume) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2073-2075)#### fn has\_data\_left(&mut self) -> Result<bool> 🔬This is a nightly-only experimental API. (`buf_read_has_data_left` [#86423](https://github.com/rust-lang/rust/issues/86423)) Check if the underlying `Read` has any data left to be read. [Read more](trait.bufread#method.has_data_left) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2132-2134)#### fn read\_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> Read all bytes into `buf` until the delimiter `byte` or EOF is reached. [Read more](trait.bufread#method.read_until) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2196-2201)#### fn read\_line(&mut self, buf: &mut String) -> Result<usize> Read all bytes until a newline (the `0xA` byte) is reached, and append them to the provided buffer. You do not need to clear the buffer before appending. [Read more](trait.bufread#method.read_line) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2234-2239)#### fn split(self, byte: u8) -> Split<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Split](struct.split "struct std::io::Split")<B> ``` impl<B: BufRead> Iterator for Split<B> type Item = Result<Vec<u8>>; ``` Returns an iterator over the contents of this reader split on the byte `byte`. [Read more](trait.bufread#method.split) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2271-2276)#### fn lines(self) -> Lines<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Lines](struct.lines "struct std::io::Lines")<B> ``` impl<B: BufRead> Iterator for Lines<B> type Item = Result<String>; ``` Returns an iterator over the lines of this reader. [Read more](trait.bufread#method.lines) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#264-278)### impl<T> Clone for Cursor<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#269-271)#### fn clone(&self) -> Self Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#274-277)#### fn clone\_from(&mut self, other: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T: Debug> Debug for Cursor<T> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T: Default> Default for Cursor<T> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)#### fn default() -> Cursor<T> Notable traits for [Cursor](struct.cursor "struct std::io::Cursor")<T> ``` impl<T> Read for Cursor<T>where     T: AsRef<[u8]>, impl Write for Cursor<&mut [u8]> impl<A> Write for Cursor<&mut Vec<u8, A>>where     A: Allocator, impl<A> Write for Cursor<Vec<u8, A>>where     A: Allocator, impl<A> Write for Cursor<Box<[u8], A>>where     A: Allocator, impl<const N: usize> Write for Cursor<[u8; N]> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T: PartialEq> PartialEq<Cursor<T>> for Cursor<T> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)#### fn eq(&self, other: &Cursor<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#316-358)### impl<T> Read for Cursor<T>where T: [AsRef](../convert/trait.asref "trait std::convert::AsRef")<[[u8](../primitive.u8)]>, [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#320-324)#### fn read(&mut self, buf: &mut [u8]) -> Result<usize> Pull some bytes from this source into the specified buffer, returning how many bytes were read. [Read more](trait.read#tymethod.read) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#326-334)#### fn read\_buf(&mut self, cursor: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Pull some bytes from this source into the specified buffer. [Read more](trait.read#method.read_buf) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#336-346)#### fn read\_vectored(&mut self, bufs: &mut [IoSliceMut<'\_>]) -> Result<usize> Like `read`, except that it reads into a slice of buffers. [Read more](trait.read#method.read_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#348-350)#### fn is\_read\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Read`er has an efficient `read_vectored` implementation. [Read more](trait.read#method.is_read_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#352-357)#### fn read\_exact(&mut self, buf: &mut [u8]) -> Result<()> Read the exact number of bytes required to fill `buf`. [Read more](trait.read#method.read_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#706-708)#### fn read\_to\_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> Read all bytes until EOF in this source, placing them into `buf`. [Read more](trait.read#method.read_to_end) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#749-751)#### fn read\_to\_string(&mut self, buf: &mut String) -> Result<usize> Read all bytes until EOF in this source, appending them to `buf`. [Read more](trait.read#method.read_to_string) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#824-839)#### fn read\_buf\_exact(&mut self, cursor: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Read the exact number of bytes required to fill `cursor`. [Read more](trait.read#method.read_buf_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#876-881)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adaptor for this instance of `Read`. [Read more](trait.read#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#919-924)#### fn bytes(self) -> Bytes<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Bytes](struct.bytes "struct std::io::Bytes")<R> ``` impl<R: Read> Iterator for Bytes<R> type Item = Result<u8>; ``` Transforms this `Read` instance to an [`Iterator`](../iter/trait.iterator "Iterator") over its bytes. [Read more](trait.read#method.bytes) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#957-962)#### fn chain<R: Read>(self, next: R) -> Chain<Self, R>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Chain](struct.chain "struct std::io::Chain")<T, U> ``` impl<T: Read, U: Read> Read for Chain<T, U> ``` Creates an adapter which will chain this stream with another. [Read more](trait.read#method.chain) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#996-1001)#### fn take(self, limit: u64) -> Take<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Take](struct.take "struct std::io::Take")<T> ``` impl<T: Read> Read for Take<T> ``` Creates an adapter which will read at most `limit` bytes from it. [Read more](trait.read#method.take) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#281-313)### impl<T> Seek for Cursor<T>where T: [AsRef](../convert/trait.asref "trait std::convert::AsRef")<[[u8](../primitive.u8)]>, [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#285-304)#### fn seek(&mut self, style: SeekFrom) -> Result<u64> Seek to an offset, in bytes, in a stream. [Read more](trait.seek#tymethod.seek) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#306-308)#### fn stream\_len(&mut self) -> Result<u64> 🔬This is a nightly-only experimental API. (`seek_stream_len` [#59359](https://github.com/rust-lang/rust/issues/59359)) Returns the length of this stream (in bytes). [Read more](trait.seek#method.stream_len) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#310-312)#### fn stream\_position(&mut self) -> Result<u64> Returns the current seek position from the start of the stream. [Read more](trait.seek#method.stream_position) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1796-1799)1.55.0 · #### fn rewind(&mut self) -> Result<()> Rewind to the beginning of a stream. [Read more](trait.seek#method.rewind) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#523-543)### impl Write for Cursor<&mut [u8]> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#525-527)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#530-532)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#535-537)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](trait.write#method.write_vectored) implementation. [Read more](trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#540-542)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#546-567)1.25.0 · ### impl<A> Write for Cursor<&mut Vec<u8, A>>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#550-552)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#554-556)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#559-561)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](trait.write#method.write_vectored) implementation. [Read more](trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#564-566)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#620-640)1.61.0 · ### impl<const N: usize> Write for Cursor<[u8; N]> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#622-624)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#627-629)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#632-634)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](trait.write#method.write_vectored) implementation. [Read more](trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#637-639)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#594-617)1.5.0 · ### impl<A> Write for Cursor<Box<[u8], A>>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#599-601)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#604-606)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#609-611)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](trait.write#method.write_vectored) implementation. [Read more](trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#614-616)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#570-591)### impl<A> Write for Cursor<Vec<u8, A>>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#574-576)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#578-580)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#583-585)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](trait.write#method.write_vectored) implementation. [Read more](trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#588-590)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T: Eq> Eq for Cursor<T> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T> StructuralEq for Cursor<T> [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T> StructuralPartialEq for Cursor<T> Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Cursor<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Cursor<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Cursor<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Cursor<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Cursor<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::io::stdout Function std::io::stdout ======================== ``` pub fn stdout() -> StdoutⓘNotable traits for Stdoutimpl Write for Stdoutimpl Write for &Stdout ``` Constructs a new handle to the standard output of the current process. Each handle returned is a reference to a shared global buffer whose access is synchronized via a mutex. If you need more explicit control over locking, see the [`Stdout::lock`](struct.stdout#method.lock "Stdout::lock") method. #### Note: Windows Portability Considerations When operating in a console, the Windows implementation of this stream does not support non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return an error. In a process with a detached console, such as one using `#![windows_subsystem = "windows"]`, or in a child process spawned from such a process, the contained handle will be null. In such cases, the standard library’s `Read` and `Write` will do nothing and silently succeed. All other I/O operations, via the standard library or via raw Windows API calls, will fail. Examples -------- Using implicit synchronization: ``` use std::io::{self, Write}; fn main() -> io::Result<()> { io::stdout().write_all(b"hello world")?; Ok(()) } ``` Using explicit synchronization: ``` use std::io::{self, Write}; fn main() -> io::Result<()> { let stdout = io::stdout(); let mut handle = stdout.lock(); handle.write_all(b"hello world")?; Ok(()) } ``` rust Struct std::io::BufWriter Struct std::io::BufWriter ========================= ``` pub struct BufWriter<W: Write> { /* private fields */ } ``` Wraps a writer and buffers its output. It can be excessively inefficient to work directly with something that implements [`Write`](trait.write "Write"). For example, every call to [`write`](../net/struct.tcpstream#method.write) on [`TcpStream`](../net/struct.tcpstream) results in a system call. A `BufWriter<W>` keeps an in-memory buffer of data and writes it to an underlying writer in large, infrequent batches. `BufWriter<W>` can improve the speed of programs that make *small* and *repeated* write calls to the same file or network socket. It does not help when writing very large amounts at once, or writing just one or a few times. It also provides no advantage when writing to a destination that is in memory, like a `[Vec](../vec/struct.vec "Vec")<u8>`. It is critical to call [`flush`](struct.bufwriter#method.flush) before `BufWriter<W>` is dropped. Though dropping will attempt to flush the contents of the buffer, any errors that happen in the process of dropping will be ignored. Calling [`flush`](struct.bufwriter#method.flush) ensures that the buffer is empty and thus dropping will not even attempt file operations. Examples -------- Let’s write the numbers one through ten to a [`TcpStream`](../net/struct.tcpstream): ``` use std::io::prelude::*; use std::net::TcpStream; let mut stream = TcpStream::connect("127.0.0.1:34254").unwrap(); for i in 0..10 { stream.write(&[i+1]).unwrap(); } ``` Because we’re not buffering, we write each one in turn, incurring the overhead of a system call per byte written. We can fix this with a `BufWriter<W>`: ``` use std::io::prelude::*; use std::io::BufWriter; use std::net::TcpStream; let mut stream = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); for i in 0..10 { stream.write(&[i+1]).unwrap(); } stream.flush().unwrap(); ``` By wrapping the stream with a `BufWriter<W>`, these ten writes are all grouped together by the buffer and will all be written out in one system call when the `stream` is flushed. Implementations --------------- [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#83-444)### impl<W: Write> BufWriter<W> [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#96-98)#### pub fn new(inner: W) -> BufWriter<W> Notable traits for [BufWriter](struct.bufwriter "struct std::io::BufWriter")<W> ``` impl<W: Write> Write for BufWriter<W> ``` Creates a new `BufWriter<W>` with a default buffer capacity. The default is currently 8 KB, but may change in the future. ##### Examples ``` use std::io::BufWriter; use std::net::TcpStream; let mut buffer = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#114-116)#### pub fn with\_capacity(capacity: usize, inner: W) -> BufWriter<W> Notable traits for [BufWriter](struct.bufwriter "struct std::io::BufWriter")<W> ``` impl<W: Write> Write for BufWriter<W> ``` Creates a new `BufWriter<W>` with at least the specified buffer capacity. ##### Examples Creating a buffer with a buffer of at least a hundred bytes. ``` use std::io::BufWriter; use std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:34254").unwrap(); let mut buffer = BufWriter::with_capacity(100, stream); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#213-215)#### pub fn get\_ref(&self) -> &W Gets a reference to the underlying writer. ##### Examples ``` use std::io::BufWriter; use std::net::TcpStream; let mut buffer = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); // we can use reference just like buffer let reference = buffer.get_ref(); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#233-235)#### pub fn get\_mut(&mut self) -> &mut W Gets a mutable reference to the underlying writer. It is inadvisable to directly write to the underlying writer. ##### Examples ``` use std::io::BufWriter; use std::net::TcpStream; let mut buffer = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); // we can use reference just like buffer let reference = buffer.get_mut(); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#251-253)1.37.0 · #### pub fn buffer(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Returns a reference to the internally buffered data. ##### Examples ``` use std::io::BufWriter; use std::net::TcpStream; let buf_writer = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); // See how many bytes are currently buffered let bytes_buffered = buf_writer.buffer().len(); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#283-285)1.46.0 · #### pub fn capacity(&self) -> usize Returns the number of bytes the internal buffer can hold without flushing. ##### Examples ``` use std::io::BufWriter; use std::net::TcpStream; let buf_writer = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); // Check the capacity of the inner buffer let capacity = buf_writer.capacity(); // Calculate how many bytes can be written without flushing let without_flush = capacity - buf_writer.buffer().len(); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#307-312)#### pub fn into\_inner(self) -> Result<W, IntoInnerError<BufWriter<W>>> Unwraps this `BufWriter<W>`, returning the underlying writer. The buffer is written out before returning the writer. ##### Errors An [`Err`](../result/enum.result#variant.Err "Err") will be returned if an error occurs while flushing the buffer. ##### Examples ``` use std::io::BufWriter; use std::net::TcpStream; let mut buffer = BufWriter::new(TcpStream::connect("127.0.0.1:34254").unwrap()); // unwrap the TcpStream and flush the buffer let stream = buffer.into_inner().unwrap(); ``` [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#337-346)1.56.0 · #### pub fn into\_parts(self) -> (W, Result<Vec<u8>, WriterPanicked>) Disassembles this `BufWriter<W>`, returning the underlying writer, and any buffered but unwritten data. If the underlying writer panicked, it is not known what portion of the data was written. In this case, we return `WriterPanicked` for the buffered data (from which the buffer contents can still be recovered). `into_parts` makes no attempt to flush data and cannot fail. ##### Examples ``` use std::io::{BufWriter, Write}; let mut buffer = [0u8; 10]; let mut stream = BufWriter::new(buffer.as_mut()); write!(stream, "too much data").unwrap(); stream.flush().expect_err("it doesn't fit"); let (recovered_writer, buffered_data) = stream.into_parts(); assert_eq!(recovered_writer.len(), 0); assert_eq!(&buffered_data.unwrap(), b"ata"); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#643-653)### impl<W: Write> Debug for BufWriter<W>where W: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#647-652)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#667-674)### impl<W: Write> Drop for BufWriter<W> [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#668-673)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#656-664)### impl<W: Write + Seek> Seek for BufWriter<W> [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#660-663)#### fn seek(&mut self, pos: SeekFrom) -> Result<u64> Seek to the offset, in bytes, in the underlying writer. Seeking always writes out the internal buffer before seeking. [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1796-1799)1.55.0 · #### fn rewind(&mut self) -> Result<()> Rewind to the beginning of a stream. [Read more](trait.seek#method.rewind) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1836-1847)#### fn stream\_len(&mut self) -> Result<u64> 🔬This is a nightly-only experimental API. (`seek_stream_len` [#59359](https://github.com/rust-lang/rust/issues/59359)) Returns the length of this stream (in bytes). [Read more](trait.seek#method.stream_len) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1873-1875)1.51.0 · #### fn stream\_position(&mut self) -> Result<u64> Returns the current seek position from the start of the stream. [Read more](trait.seek#method.stream_position) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#514-640)### impl<W: Write> Write for BufWriter<W> [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#516-529)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#532-545)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#547-631)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#633-635)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](trait.write#method.write_vectored) implementation. [Read more](trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#637-639)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](trait.write#method.by_ref) Auto Trait Implementations -------------------------- ### impl<W> RefUnwindSafe for BufWriter<W>where W: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<W> Send for BufWriter<W>where W: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<W> Sync for BufWriter<W>where W: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<W> Unpin for BufWriter<W>where W: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<W> UnwindSafe for BufWriter<W>where W: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::io::prelude Module std::io::prelude ======================= The I/O Prelude. The purpose of this module is to alleviate imports of many common I/O traits by adding a glob import to the top of I/O heavy modules: ``` use std::io::prelude::*; ``` Re-exports ---------- `pub use super::[BufRead](../trait.bufread "trait std::io::BufRead");` `pub use super::[Read](../trait.read "trait std::io::Read");` `pub use super::[Seek](../trait.seek "trait std::io::Seek");` `pub use super::[Write](../trait.write "trait std::io::Write");` rust Struct std::simd::Mask Struct std::simd::Mask ====================== ``` #[repr(transparent)]pub struct Mask<T, const LANES: usize>(_)where    T: MaskElement,    LaneCount<LANES>: SupportedLaneCount; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector mask for `LANES` elements of width specified by `Element`. Masks represent boolean inclusion/exclusion on a per-lane basis. The layout of this type is unspecified. Implementations --------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#110)### impl<T, const LANES: usize> Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#116)#### pub fn splat(value: bool) -> Mask<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Construct a mask by setting all lanes to the given value. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#121)#### pub fn from\_array(array: [bool; LANES]) -> Mask<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts an array of bools to a SIMD mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#137)#### pub fn to\_array(self) -> [bool; LANES] 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a SIMD mask to an array of bools. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#162)#### pub unsafe fn from\_int\_unchecked(value: Simd<T, LANES>) -> Mask<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a vector of integers to a mask, where 0 represents `false` and -1 represents `true`. ##### Safety All lanes must be either 0 or -1. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#174)#### pub fn from\_int(value: Simd<T, LANES>) -> Mask<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a vector of integers to a mask, where 0 represents `false` and -1 represents `true`. ##### Panics Panics if any lane is not 0 or -1. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#184)#### pub fn to\_int(self) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts the mask to a vector of integers, where 0 represents `false` and -1 represents `true`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#191)#### pub fn cast<U>(self) -> Mask<U, LANES>where U: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts the mask to a mask of any other lane size. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#201)#### pub unsafe fn test\_unchecked(&self, lane: usize) -> bool 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Tests the value of the specified lane. ##### Safety `lane` must be less than `LANES`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#212)#### pub fn test(&self, lane: usize) -> bool 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Tests the value of the specified lane. ##### Panics Panics if `lane` is greater than or equal to the number of lanes in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#223)#### pub unsafe fn set\_unchecked(&mut self, lane: usize, value: bool) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Sets the value of the specified lane. ##### Safety `lane` must be less than `LANES`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#235)#### pub fn set(&mut self, lane: usize, value: bool) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Sets the value of the specified lane. ##### Panics Panics if `lane` is greater than or equal to the number of lanes in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#246)#### pub fn any(self) -> bool 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true if any lane is set, or false otherwise. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#253)#### pub fn all(self) -> bool 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true if all lanes are set, or false otherwise. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/select.rs.html#4)### impl<T, const LANES: usize> Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/select.rs.html#26-32)#### pub fn select<U>( self, true\_values: Simd<U, LANES>, false\_values: Simd<U, LANES>) -> Simd<U, LANES>where U: [SimdElement](trait.simdelement "trait std::simd::SimdElement")<Mask = T>, 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Choose lanes from two vectors. For each lane in the mask, choose the corresponding lane from `true_values` if that lane mask is true, and `false_values` if that lane mask is false. ##### Examples ``` let a = Simd::from_array([0, 1, 2, 3]); let b = Simd::from_array([4, 5, 6, 7]); let mask = Mask::from_array([true, false, false, true]); let c = mask.select(a, b); assert_eq!(c.to_array(), [0, 5, 6, 3]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/select.rs.html#56)#### pub fn select\_mask( self, true\_values: Mask<T, LANES>, false\_values: Mask<T, LANES>) -> Mask<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Choose lanes from two masks. For each lane in the mask, choose the corresponding lane from `true_values` if that lane mask is true, and `false_values` if that lane mask is false. ##### Examples ``` let a = Mask::<i32, 4>::from_array([true, true, false, false]); let b = Mask::<i32, 4>::from_array([false, false, true, true]); let mask = Mask::<i32, 4>::from_array([true, false, false, true]); let c = mask.select_mask(a, b); assert_eq!(c.to_array(), [true, false, true, false]); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#327)### impl<T, const LANES: usize> BitAnd<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#335)#### fn bitand(self, rhs: Mask<T, LANES>) -> Mask<T, LANES> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#353)### impl<T, const LANES: usize> BitAnd<Mask<T, LANES>> for boolwhere T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#361)#### fn bitand(self, rhs: Mask<T, LANES>) -> Mask<T, LANES> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#340)### impl<T, const LANES: usize> BitAnd<bool> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#348)#### fn bitand(self, rhs: bool) -> Mask<T, LANES> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#457)### impl<T, const LANES: usize> BitAndAssign<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#463)#### fn bitand\_assign(&mut self, rhs: Mask<T, LANES>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#468)### impl<T, const LANES: usize> BitAndAssign<bool> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#474)#### fn bitand\_assign(&mut self, rhs: bool) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#366)### impl<T, const LANES: usize> BitOr<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#374)#### fn bitor(self, rhs: Mask<T, LANES>) -> Mask<T, LANES> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#392)### impl<T, const LANES: usize> BitOr<Mask<T, LANES>> for boolwhere T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#400)#### fn bitor(self, rhs: Mask<T, LANES>) -> Mask<T, LANES> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#379)### impl<T, const LANES: usize> BitOr<bool> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#387)#### fn bitor(self, rhs: bool) -> Mask<T, LANES> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#479)### impl<T, const LANES: usize> BitOrAssign<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#485)#### fn bitor\_assign(&mut self, rhs: Mask<T, LANES>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#490)### impl<T, const LANES: usize> BitOrAssign<bool> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#496)#### fn bitor\_assign(&mut self, rhs: bool) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#405)### impl<T, const LANES: usize> BitXor<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#413)#### fn bitxor( self, rhs: Mask<T, LANES>) -> <Mask<T, LANES> as BitXor<Mask<T, LANES>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#431)### impl<T, const LANES: usize> BitXor<Mask<T, LANES>> for boolwhere T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#439)#### fn bitxor(self, rhs: Mask<T, LANES>) -> <bool as BitXor<Mask<T, LANES>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#418)### impl<T, const LANES: usize> BitXor<bool> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#426)#### fn bitxor(self, rhs: bool) -> <Mask<T, LANES> as BitXor<bool>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#501)### impl<T, const LANES: usize> BitXorAssign<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#507)#### fn bitxor\_assign(&mut self, rhs: Mask<T, LANES>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#512)### impl<T, const LANES: usize> BitXorAssign<bool> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#518)#### fn bitxor\_assign(&mut self, rhs: bool) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#100)### impl<T, const LANES: usize> Clone for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#105)#### fn clone(&self) -> Mask<T, LANES> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#315)### impl<T, const LANES: usize> Debug for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement") + [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#320)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#279)### impl<T, const LANES: usize> Default for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#286)#### fn default() -> Mask<T, LANES> Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#259)### impl<T, const LANES: usize> From<[bool; LANES]> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#264)#### fn from(array: [bool; LANES]) -> Mask<T, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#269)### impl<T, const LANES: usize> From<Mask<T, LANES>> for [bool; LANES]where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#274)#### fn from(vector: Mask<T, LANES>) -> [bool; LANES] Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)### impl<const LANES: usize> From<Mask<i16, LANES>> for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)#### fn from(value: Mask<i16, LANES>) -> Mask<i32, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)### impl<const LANES: usize> From<Mask<i16, LANES>> for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)#### fn from(value: Mask<i16, LANES>) -> Mask<i64, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)### impl<const LANES: usize> From<Mask<i16, LANES>> for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)#### fn from(value: Mask<i16, LANES>) -> Mask<i8, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)### impl<const LANES: usize> From<Mask<i16, LANES>> for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#592)#### fn from(value: Mask<i16, LANES>) -> Mask<isize, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)### impl<const LANES: usize> From<Mask<i32, LANES>> for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)#### fn from(value: Mask<i32, LANES>) -> Mask<i16, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)### impl<const LANES: usize> From<Mask<i32, LANES>> for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)#### fn from(value: Mask<i32, LANES>) -> Mask<i64, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)### impl<const LANES: usize> From<Mask<i32, LANES>> for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)#### fn from(value: Mask<i32, LANES>) -> Mask<i8, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)### impl<const LANES: usize> From<Mask<i32, LANES>> for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#593)#### fn from(value: Mask<i32, LANES>) -> Mask<isize, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)### impl<const LANES: usize> From<Mask<i64, LANES>> for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)#### fn from(value: Mask<i64, LANES>) -> Mask<i16, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)### impl<const LANES: usize> From<Mask<i64, LANES>> for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)#### fn from(value: Mask<i64, LANES>) -> Mask<i32, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)### impl<const LANES: usize> From<Mask<i64, LANES>> for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)#### fn from(value: Mask<i64, LANES>) -> Mask<i8, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)### impl<const LANES: usize> From<Mask<i64, LANES>> for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#594)#### fn from(value: Mask<i64, LANES>) -> Mask<isize, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)### impl<const LANES: usize> From<Mask<i8, LANES>> for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)#### fn from(value: Mask<i8, LANES>) -> Mask<i16, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)### impl<const LANES: usize> From<Mask<i8, LANES>> for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)#### fn from(value: Mask<i8, LANES>) -> Mask<i32, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)### impl<const LANES: usize> From<Mask<i8, LANES>> for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)#### fn from(value: Mask<i8, LANES>) -> Mask<i64, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)### impl<const LANES: usize> From<Mask<i8, LANES>> for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#591)#### fn from(value: Mask<i8, LANES>) -> Mask<isize, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)### impl<const LANES: usize> From<Mask<isize, LANES>> for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)#### fn from(value: Mask<isize, LANES>) -> Mask<i16, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)### impl<const LANES: usize> From<Mask<isize, LANES>> for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)#### fn from(value: Mask<isize, LANES>) -> Mask<i32, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)### impl<const LANES: usize> From<Mask<isize, LANES>> for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)#### fn from(value: Mask<isize, LANES>) -> Mask<i64, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)### impl<const LANES: usize> From<Mask<isize, LANES>> for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#595)#### fn from(value: Mask<isize, LANES>) -> Mask<i8, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#444)### impl<T, const LANES: usize> Not for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#452)#### fn not(self) -> <Mask<T, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#291)### impl<T, const LANES: usize> PartialEq<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement") + [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#298)#### fn eq(&self, other: &Mask<T, LANES>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#303)### impl<T, const LANES: usize> PartialOrd<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement") + [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#310)#### fn partial\_cmp(&self, other: &Mask<T, LANES>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_max(self, other: Mask<i16, LANES>) -> Mask<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_min(self, other: Mask<i16, LANES>) -> Mask<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_clamp( self, min: Mask<i16, LANES>, max: Mask<i16, LANES>) -> Mask<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_max(self, other: Mask<i32, LANES>) -> Mask<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_min(self, other: Mask<i32, LANES>) -> Mask<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_clamp( self, min: Mask<i32, LANES>, max: Mask<i32, LANES>) -> Mask<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_max(self, other: Mask<i64, LANES>) -> Mask<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_min(self, other: Mask<i64, LANES>) -> Mask<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_clamp( self, min: Mask<i64, LANES>, max: Mask<i64, LANES>) -> Mask<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_max(self, other: Mask<i8, LANES>) -> Mask<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_min(self, other: Mask<i8, LANES>) -> Mask<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_clamp(self, min: Mask<i8, LANES>, max: Mask<i8, LANES>) -> Mask<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_max(self, other: Mask<isize, LANES>) -> Mask<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_min(self, other: Mask<isize, LANES>) -> Mask<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_clamp( self, min: Mask<isize, LANES>, max: Mask<isize, LANES>) -> Mask<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_eq( self, other: Mask<i16, LANES>) -> <Mask<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_ne( self, other: Mask<i16, LANES>) -> <Mask<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_eq( self, other: Mask<i32, LANES>) -> <Mask<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_ne( self, other: Mask<i32, LANES>) -> <Mask<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_eq( self, other: Mask<i64, LANES>) -> <Mask<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_ne( self, other: Mask<i64, LANES>) -> <Mask<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_eq( self, other: Mask<i8, LANES>) -> <Mask<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_ne( self, other: Mask<i8, LANES>) -> <Mask<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_eq( self, other: Mask<isize, LANES>) -> <Mask<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)#### fn simd\_ne( self, other: Mask<isize, LANES>) -> <Mask<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_lt( self, other: Mask<i16, LANES>) -> <Mask<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_le( self, other: Mask<i16, LANES>) -> <Mask<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_gt( self, other: Mask<i16, LANES>) -> <Mask<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_ge( self, other: Mask<i16, LANES>) -> <Mask<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_lt( self, other: Mask<i32, LANES>) -> <Mask<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_le( self, other: Mask<i32, LANES>) -> <Mask<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_gt( self, other: Mask<i32, LANES>) -> <Mask<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_ge( self, other: Mask<i32, LANES>) -> <Mask<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_lt( self, other: Mask<i64, LANES>) -> <Mask<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_le( self, other: Mask<i64, LANES>) -> <Mask<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_gt( self, other: Mask<i64, LANES>) -> <Mask<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_ge( self, other: Mask<i64, LANES>) -> <Mask<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_lt( self, other: Mask<i8, LANES>) -> <Mask<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_le( self, other: Mask<i8, LANES>) -> <Mask<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_gt( self, other: Mask<i8, LANES>) -> <Mask<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_ge( self, other: Mask<i8, LANES>) -> <Mask<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_lt( self, other: Mask<isize, LANES>) -> <Mask<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_le( self, other: Mask<isize, LANES>) -> <Mask<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_gt( self, other: Mask<isize, LANES>) -> <Mask<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)#### fn simd\_ge( self, other: Mask<isize, LANES>) -> <Mask<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 1>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u8) -> Mask<T, 1> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 16>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u16 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u16 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u16) -> Mask<T, 16> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 2>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u8) -> Mask<T, 2> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 32>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u32 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u32 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u32) -> Mask<T, 32> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 4>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u8) -> Mask<T, 4> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 64>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u64 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u64 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u64) -> Mask<T, 64> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 8>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn to\_bitmask(self) -> u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)#### fn from\_bitmask(bitmask: u8) -> Mask<T, 8> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#93)### impl<T, const LANES: usize> Copy for Mask<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), Auto Trait Implementations -------------------------- ### impl<T, const LANES: usize> RefUnwindSafe for Mask<T, LANES>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, const LANES: usize> Send for Mask<T, LANES>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T, const LANES: usize> Sync for Mask<T, LANES>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T, const LANES: usize> Unpin for Mask<T, LANES>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T, const LANES: usize> UnwindSafe for Mask<T, LANES>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Type Definition std::simd::f64x8 Type Definition std::simd::f64x8 ================================ ``` pub type f64x8 = Simd<f64, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with eight elements of type `f64`. rust Trait std::simd::SimdInt Trait std::simd::SimdInt ======================== ``` pub trait SimdInt: Copy + Sealed { type Mask; type Scalar; Show 15 methods fn saturating_add(self, second: Self) -> Self; fn saturating_sub(self, second: Self) -> Self; fn abs(self) -> Self; fn saturating_abs(self) -> Self; fn saturating_neg(self) -> Self; fn is_positive(self) -> Self::Mask; fn is_negative(self) -> Self::Mask; fn signum(self) -> Self; fn reduce_sum(self) -> Self::Scalar; fn reduce_product(self) -> Self::Scalar; fn reduce_max(self) -> Self::Scalar; fn reduce_min(self) -> Self::Scalar; fn reduce_and(self) -> Self::Scalar; fn reduce_or(self) -> Self::Scalar; fn reduce_xor(self) -> Self::Scalar; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Operations on SIMD vectors of signed integers. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#9)#### type Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#12)#### type Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#30)#### fn saturating\_add(self, second: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. ##### Examples ``` use core::i32::{MIN, MAX}; let x = Simd::from_array([MIN, 0, 1, MAX]); let max = Simd::splat(MAX); let unsat = x + max; let sat = x.saturating_add(max); assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2])); assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#47)#### fn saturating\_sub(self, second: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. ##### Examples ``` use core::i32::{MIN, MAX}; let x = Simd::from_array([MIN, -2, -1, MAX]); let max = Simd::splat(MAX); let unsat = x - max; let sat = x.saturating_sub(max); assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0])); assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#62)#### fn abs(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value. ##### Examples ``` use core::i32::{MIN, MAX}; let xs = Simd::from_array([MIN, MIN +1, -5, 0]); assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#80)#### fn saturating\_abs(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself. ##### Examples ``` use core::i32::{MIN, MAX}; let xs = Simd::from_array([MIN, -2, 0, 3]); let unsat = xs.abs(); let sat = xs.saturating_abs(); assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3])); assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#98)#### fn saturating\_neg(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself. ##### Examples ``` use core::i32::{MIN, MAX}; let x = Simd::from_array([MIN, -2, 3, MAX]); let unsat = -x; let sat = x.saturating_neg(); assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1])); assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#101)#### fn is\_positive(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each positive lane and false if it is zero or negative. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#104)#### fn is\_negative(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each negative lane and false if it is zero or positive. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#110)#### fn signum(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns numbers representing the sign of each lane. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#128)#### fn reduce\_sum(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. ##### Examples ``` let v = i32x4::from_array([1, 2, 3, 4]); assert_eq!(v.reduce_sum(), 10); // SIMD integer addition is always wrapping let v = i32x4::from_array([i32::MAX, 1, 0, 0]); assert_eq!(v.reduce_sum(), i32::MIN); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#146)#### fn reduce\_product(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. ##### Examples ``` let v = i32x4::from_array([1, 2, 3, 4]); assert_eq!(v.reduce_product(), 24); // SIMD integer multiplication is always wrapping let v = i32x4::from_array([i32::MAX, 2, 1, 1]); assert!(v.reduce_product() < i32::MAX); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#160)#### fn reduce\_max(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. ##### Examples ``` let v = i32x4::from_array([1, 2, 3, 4]); assert_eq!(v.reduce_max(), 4); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#174)#### fn reduce\_min(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. ##### Examples ``` let v = i32x4::from_array([1, 2, 3, 4]); assert_eq!(v.reduce_min(), 1); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#177)#### fn reduce\_and(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#180)#### fn reduce\_or(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#183)#### fn reduce\_xor(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i8 as SimdElement>::Mask, LANES> #### type Scalar = i8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i16 as SimdElement>::Mask, LANES> #### type Scalar = i16 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i32 as SimdElement>::Mask, LANES> #### type Scalar = i32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i64 as SimdElement>::Mask, LANES> #### type Scalar = i64 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<isize as SimdElement>::Mask, LANES> #### type Scalar = isize rust Type Definition std::simd::u64x2 Type Definition std::simd::u64x2 ================================ ``` pub type u64x2 = Simd<u64, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with two elements of type `u64`. rust Type Definition std::simd::masksizex4 Type Definition std::simd::masksizex4 ===================================== ``` pub type masksizex4 = Mask<isize, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with four elements of pointer width. rust Type Definition std::simd::f64x4 Type Definition std::simd::f64x4 ================================ ``` pub type f64x4 = Simd<f64, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with four elements of type `f64`. rust Type Definition std::simd::masksizex8 Type Definition std::simd::masksizex8 ===================================== ``` pub type masksizex8 = Mask<isize, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with eight elements of pointer width. rust Type Definition std::simd::u16x16 Type Definition std::simd::u16x16 ================================= ``` pub type u16x16 = Simd<u16, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with 16 elements of type `u16`. rust Type Definition std::simd::i32x2 Type Definition std::simd::i32x2 ================================ ``` pub type i32x2 = Simd<i32, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with two elements of type `i32`. rust Trait std::simd::SupportedLaneCount Trait std::simd::SupportedLaneCount =================================== ``` pub trait SupportedLaneCount: Sealed { } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Statically guarantees that a lane count is marked as supported. This trait is *sealed*: the list of implementors below is total. Users do not have the ability to mark additional `LaneCount<N>` values as supported. Only SIMD vectors with supported lane counts are constructable. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#26)### impl SupportedLaneCount for LaneCount<1> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#29)### impl SupportedLaneCount for LaneCount<2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#32)### impl SupportedLaneCount for LaneCount<4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#35)### impl SupportedLaneCount for LaneCount<8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#38)### impl SupportedLaneCount for LaneCount<16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#41)### impl SupportedLaneCount for LaneCount<32> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#44)### impl SupportedLaneCount for LaneCount<64> rust Module std::simd Module std::simd ================ 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Portable SIMD module. This module offers a portable abstraction for SIMD operations that is not bound to any particular hardware architecture. Macros ------ [simd\_swizzle](macro.simd_swizzle "std::simd::simd_swizzle macro")Experimental Constructs a new SIMD vector by copying elements from selected lanes in other vectors. Structs ------- [LaneCount](struct.lanecount "std::simd::LaneCount struct")Experimental Specifies the number of lanes in a SIMD vector as a type. [Mask](struct.mask "std::simd::Mask struct")Experimental A SIMD vector mask for `LANES` elements of width specified by `Element`. [Simd](struct.simd "std::simd::Simd struct")Experimental A SIMD vector of `LANES` elements of type `T`. `Simd<T, N>` has the same shape as [`[T; N]`](../primitive.array), but operates like `T`. Enums ----- [Which](enum.which "std::simd::Which enum")Experimental Specifies a lane index into one of two SIMD vectors. Traits ------ [MaskElement](trait.maskelement "std::simd::MaskElement trait")Experimental Marker trait for types that may be used as SIMD mask elements. [SimdElement](trait.simdelement "std::simd::SimdElement trait")Experimental Marker trait for types that may be used as SIMD vector elements. [SimdFloat](trait.simdfloat "std::simd::SimdFloat trait")Experimental Operations on SIMD vectors of floats. [SimdInt](trait.simdint "std::simd::SimdInt trait")Experimental Operations on SIMD vectors of signed integers. [SimdOrd](trait.simdord "std::simd::SimdOrd trait")Experimental Parallel `Ord`. [SimdPartialEq](trait.simdpartialeq "std::simd::SimdPartialEq trait")Experimental Parallel `PartialEq`. [SimdPartialOrd](trait.simdpartialord "std::simd::SimdPartialOrd trait")Experimental Parallel `PartialOrd`. [SimdUint](trait.simduint "std::simd::SimdUint trait")Experimental Operations on SIMD vectors of unsigned integers. [StdFloat](trait.stdfloat "std::simd::StdFloat trait")Experimental This trait provides a possibly-temporary implementation of float functions that may, in the absence of hardware support, canonicalize to calling an operating system’s `math.h` dynamically-loaded library (also known as a shared object). As these conditionally require runtime support, they should only appear in binaries built assuming OS support: `std`. [SupportedLaneCount](trait.supportedlanecount "std::simd::SupportedLaneCount trait")Experimental Statically guarantees that a lane count is marked as supported. [Swizzle](trait.swizzle "std::simd::Swizzle trait")Experimental Create a vector from the elements of another vector. [Swizzle2](trait.swizzle2 "std::simd::Swizzle2 trait")Experimental Create a vector from the elements of two other vectors. [ToBitMask](trait.tobitmask "std::simd::ToBitMask trait")Experimental Converts masks to and from integer bitmasks. Type Definitions ---------------- [f32x2](type.f32x2 "std::simd::f32x2 type")Experimental A 64-bit SIMD vector with two elements of type `f32`. [f32x4](type.f32x4 "std::simd::f32x4 type")Experimental A 128-bit SIMD vector with four elements of type `f32`. [f32x8](type.f32x8 "std::simd::f32x8 type")Experimental A 256-bit SIMD vector with eight elements of type `f32`. [f32x16](type.f32x16 "std::simd::f32x16 type")Experimental A 512-bit SIMD vector with 16 elements of type `f32`. [f64x2](type.f64x2 "std::simd::f64x2 type")Experimental A 128-bit SIMD vector with two elements of type `f64`. [f64x4](type.f64x4 "std::simd::f64x4 type")Experimental A 256-bit SIMD vector with four elements of type `f64`. [f64x8](type.f64x8 "std::simd::f64x8 type")Experimental A 512-bit SIMD vector with eight elements of type `f64`. [i8x4](type.i8x4 "std::simd::i8x4 type")Experimental A 32-bit SIMD vector with four elements of type `i8`. [i8x8](type.i8x8 "std::simd::i8x8 type")Experimental A 64-bit SIMD vector with eight elements of type `i8`. [i8x16](type.i8x16 "std::simd::i8x16 type")Experimental A 128-bit SIMD vector with 16 elements of type `i8`. [i8x32](type.i8x32 "std::simd::i8x32 type")Experimental A 256-bit SIMD vector with 32 elements of type `i8`. [i8x64](type.i8x64 "std::simd::i8x64 type")Experimental A 512-bit SIMD vector with 64 elements of type `i8`. [i16x2](type.i16x2 "std::simd::i16x2 type")Experimental A 32-bit SIMD vector with two elements of type `i16`. [i16x4](type.i16x4 "std::simd::i16x4 type")Experimental A 64-bit SIMD vector with four elements of type `i16`. [i16x8](type.i16x8 "std::simd::i16x8 type")Experimental A 128-bit SIMD vector with eight elements of type `i16`. [i16x16](type.i16x16 "std::simd::i16x16 type")Experimental A 256-bit SIMD vector with 16 elements of type `i16`. [i16x32](type.i16x32 "std::simd::i16x32 type")Experimental A 512-bit SIMD vector with 32 elements of type `i16`. [i32x2](type.i32x2 "std::simd::i32x2 type")Experimental A 64-bit SIMD vector with two elements of type `i32`. [i32x4](type.i32x4 "std::simd::i32x4 type")Experimental A 128-bit SIMD vector with four elements of type `i32`. [i32x8](type.i32x8 "std::simd::i32x8 type")Experimental A 256-bit SIMD vector with eight elements of type `i32`. [i32x16](type.i32x16 "std::simd::i32x16 type")Experimental A 512-bit SIMD vector with 16 elements of type `i32`. [i64x2](type.i64x2 "std::simd::i64x2 type")Experimental A 128-bit SIMD vector with two elements of type `i64`. [i64x4](type.i64x4 "std::simd::i64x4 type")Experimental A 256-bit SIMD vector with four elements of type `i64`. [i64x8](type.i64x8 "std::simd::i64x8 type")Experimental A 512-bit SIMD vector with eight elements of type `i64`. [isizex2](type.isizex2 "std::simd::isizex2 type")Experimental A SIMD vector with two elements of type `isize`. [isizex4](type.isizex4 "std::simd::isizex4 type")Experimental A SIMD vector with four elements of type `isize`. [isizex8](type.isizex8 "std::simd::isizex8 type")Experimental A SIMD vector with eight elements of type `isize`. [mask8x8](type.mask8x8 "std::simd::mask8x8 type")Experimental A mask for SIMD vectors with eight elements of 8 bits. [mask8x16](type.mask8x16 "std::simd::mask8x16 type")Experimental A mask for SIMD vectors with 16 elements of 8 bits. [mask8x32](type.mask8x32 "std::simd::mask8x32 type")Experimental A mask for SIMD vectors with 32 elements of 8 bits. [mask8x64](type.mask8x64 "std::simd::mask8x64 type")Experimental A mask for SIMD vectors with 64 elements of 8 bits. [mask16x4](type.mask16x4 "std::simd::mask16x4 type")Experimental A mask for SIMD vectors with four elements of 16 bits. [mask16x8](type.mask16x8 "std::simd::mask16x8 type")Experimental A mask for SIMD vectors with eight elements of 16 bits. [mask16x16](type.mask16x16 "std::simd::mask16x16 type")Experimental A mask for SIMD vectors with 16 elements of 16 bits. [mask16x32](type.mask16x32 "std::simd::mask16x32 type")Experimental A mask for SIMD vectors with 32 elements of 16 bits. [mask32x2](type.mask32x2 "std::simd::mask32x2 type")Experimental A mask for SIMD vectors with two elements of 32 bits. [mask32x4](type.mask32x4 "std::simd::mask32x4 type")Experimental A mask for SIMD vectors with four elements of 32 bits. [mask32x8](type.mask32x8 "std::simd::mask32x8 type")Experimental A mask for SIMD vectors with eight elements of 32 bits. [mask32x16](type.mask32x16 "std::simd::mask32x16 type")Experimental A mask for SIMD vectors with 16 elements of 32 bits. [mask64x2](type.mask64x2 "std::simd::mask64x2 type")Experimental A mask for SIMD vectors with two elements of 64 bits. [mask64x4](type.mask64x4 "std::simd::mask64x4 type")Experimental A mask for SIMD vectors with four elements of 64 bits. [mask64x8](type.mask64x8 "std::simd::mask64x8 type")Experimental A mask for SIMD vectors with eight elements of 64 bits. [masksizex2](type.masksizex2 "std::simd::masksizex2 type")Experimental A mask for SIMD vectors with two elements of pointer width. [masksizex4](type.masksizex4 "std::simd::masksizex4 type")Experimental A mask for SIMD vectors with four elements of pointer width. [masksizex8](type.masksizex8 "std::simd::masksizex8 type")Experimental A mask for SIMD vectors with eight elements of pointer width. [u8x4](type.u8x4 "std::simd::u8x4 type")Experimental A 32-bit SIMD vector with four elements of type `u8`. [u8x8](type.u8x8 "std::simd::u8x8 type")Experimental A 64-bit SIMD vector with eight elements of type `u8`. [u8x16](type.u8x16 "std::simd::u8x16 type")Experimental A 128-bit SIMD vector with 16 elements of type `u8`. [u8x32](type.u8x32 "std::simd::u8x32 type")Experimental A 256-bit SIMD vector with 32 elements of type `u8`. [u8x64](type.u8x64 "std::simd::u8x64 type")Experimental A 512-bit SIMD vector with 64 elements of type `u8`. [u16x2](type.u16x2 "std::simd::u16x2 type")Experimental A 32-bit SIMD vector with two elements of type `u16`. [u16x4](type.u16x4 "std::simd::u16x4 type")Experimental A 64-bit SIMD vector with four elements of type `u16`. [u16x8](type.u16x8 "std::simd::u16x8 type")Experimental A 128-bit SIMD vector with eight elements of type `u16`. [u16x16](type.u16x16 "std::simd::u16x16 type")Experimental A 256-bit SIMD vector with 16 elements of type `u16`. [u16x32](type.u16x32 "std::simd::u16x32 type")Experimental A 512-bit SIMD vector with 32 elements of type `u16`. [u32x2](type.u32x2 "std::simd::u32x2 type")Experimental A 64-bit SIMD vector with two elements of type `u32`. [u32x4](type.u32x4 "std::simd::u32x4 type")Experimental A 128-bit SIMD vector with four elements of type `u32`. [u32x8](type.u32x8 "std::simd::u32x8 type")Experimental A 256-bit SIMD vector with eight elements of type `u32`. [u32x16](type.u32x16 "std::simd::u32x16 type")Experimental A 512-bit SIMD vector with 16 elements of type `u32`. [u64x2](type.u64x2 "std::simd::u64x2 type")Experimental A 128-bit SIMD vector with two elements of type `u64`. [u64x4](type.u64x4 "std::simd::u64x4 type")Experimental A 256-bit SIMD vector with four elements of type `u64`. [u64x8](type.u64x8 "std::simd::u64x8 type")Experimental A 512-bit SIMD vector with eight elements of type `u64`. [usizex2](type.usizex2 "std::simd::usizex2 type")Experimental A SIMD vector with two elements of type `usize`. [usizex4](type.usizex4 "std::simd::usizex4 type")Experimental A SIMD vector with four elements of type `usize`. [usizex8](type.usizex8 "std::simd::usizex8 type")Experimental A SIMD vector with eight elements of type `usize`.
programming_docs
rust Type Definition std::simd::i16x32 Type Definition std::simd::i16x32 ================================= ``` pub type i16x32 = Simd<i16, 32>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 32 elements of type `i16`. rust Type Definition std::simd::mask32x2 Type Definition std::simd::mask32x2 =================================== ``` pub type mask32x2 = Mask<i32, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with two elements of 32 bits. rust Type Definition std::simd::i16x2 Type Definition std::simd::i16x2 ================================ ``` pub type i16x2 = Simd<i16, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 32-bit SIMD vector with two elements of type `i16`. rust Type Definition std::simd::mask16x16 Type Definition std::simd::mask16x16 ==================================== ``` pub type mask16x16 = Mask<i16, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with 16 elements of 16 bits. rust Enum std::simd::Which Enum std::simd::Which ===================== ``` pub enum Which { First(usize), Second(usize), } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Specifies a lane index into one of two SIMD vectors. This is an input type for [Swizzle2](trait.swizzle2 "Swizzle2") and helper macros like [simd\_swizzle](macro.simd_swizzle "simd_swizzle"). Variants -------- ### `First([usize](../primitive.usize))` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Index of a lane in the first input SIMD vector. ### `Second([usize](../primitive.usize))` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Index of a lane in the second input SIMD vector. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Clone for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)#### fn clone(&self) -> Which Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Debug for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Hash for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Ord for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)#### fn cmp(&self, other: &Which) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl PartialEq<Which> for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)#### fn eq(&self, other: &Which) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl PartialOrd<Which> for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)#### fn partial\_cmp(&self, other: &Which) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Copy for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Eq for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl StructuralEq for Which [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl StructuralPartialEq for Which Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for Which ### impl Send for Which ### impl Sync for Which ### impl Unpin for Which ### impl UnwindSafe for Which Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Type Definition std::simd::mask32x16 Type Definition std::simd::mask32x16 ==================================== ``` pub type mask32x16 = Mask<i32, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with 16 elements of 32 bits. rust Type Definition std::simd::u8x64 Type Definition std::simd::u8x64 ================================ ``` pub type u8x64 = Simd<u8, 64>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 64 elements of type `u8`. rust Type Definition std::simd::f64x2 Type Definition std::simd::f64x2 ================================ ``` pub type f64x2 = Simd<f64, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with two elements of type `f64`. rust Type Definition std::simd::f32x16 Type Definition std::simd::f32x16 ================================= ``` pub type f32x16 = Simd<f32, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 16 elements of type `f32`. rust Type Definition std::simd::u64x8 Type Definition std::simd::u64x8 ================================ ``` pub type u64x8 = Simd<u64, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with eight elements of type `u64`. rust Trait std::simd::ToBitMask Trait std::simd::ToBitMask ========================== ``` pub trait ToBitMask: Sealed { type BitMask; fn to_bitmask(self) -> Self::BitMask; fn from_bitmask(bitmask: Self::BitMask) -> Self; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts masks to and from integer bitmasks. Each bit of the bitmask corresponds to a mask lane, starting with the LSB. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#21)#### type BitMask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The integer bitmask type. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#24)#### fn to\_bitmask(self) -> Self::BitMask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a mask to a bitmask. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#27)#### fn from\_bitmask(bitmask: Self::BitMask) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a bitmask to a mask. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 1>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 2>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 4>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 8>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 16>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u16 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 32>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/to_bitmask.rs.html#63-71)### impl<T> ToBitMask for Mask<T, 64>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), #### type BitMask = u64 rust Type Definition std::simd::u64x4 Type Definition std::simd::u64x4 ================================ ``` pub type u64x4 = Simd<u64, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with four elements of type `u64`. rust Type Definition std::simd::masksizex2 Type Definition std::simd::masksizex2 ===================================== ``` pub type masksizex2 = Mask<isize, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with two elements of pointer width. rust Type Definition std::simd::mask16x8 Type Definition std::simd::mask16x8 =================================== ``` pub type mask16x8 = Mask<i16, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with eight elements of 16 bits. rust Type Definition std::simd::i32x8 Type Definition std::simd::i32x8 ================================ ``` pub type i32x8 = Simd<i32, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with eight elements of type `i32`. rust Type Definition std::simd::u32x16 Type Definition std::simd::u32x16 ================================= ``` pub type u32x16 = Simd<u32, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 16 elements of type `u32`. rust Type Definition std::simd::mask32x8 Type Definition std::simd::mask32x8 =================================== ``` pub type mask32x8 = Mask<i32, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with eight elements of 32 bits. rust Type Definition std::simd::i16x8 Type Definition std::simd::i16x8 ================================ ``` pub type i16x8 = Simd<i16, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with eight elements of type `i16`. rust Type Definition std::simd::i8x8 Type Definition std::simd::i8x8 =============================== ``` pub type i8x8 = Simd<i8, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with eight elements of type `i8`. rust Type Definition std::simd::u8x4 Type Definition std::simd::u8x4 =============================== ``` pub type u8x4 = Simd<u8, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 32-bit SIMD vector with four elements of type `u8`. rust Trait std::simd::SimdUint Trait std::simd::SimdUint ========================= ``` pub trait SimdUint: Copy + Sealed { type Scalar; fn saturating_add(self, second: Self) -> Self; fn saturating_sub(self, second: Self) -> Self; fn reduce_sum(self) -> Self::Scalar; fn reduce_product(self) -> Self::Scalar; fn reduce_max(self) -> Self::Scalar; fn reduce_min(self) -> Self::Scalar; fn reduce_and(self) -> Self::Scalar; fn reduce_or(self) -> Self::Scalar; fn reduce_xor(self) -> Self::Scalar; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Operations on SIMD vectors of unsigned integers. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#7)#### type Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#25)#### fn saturating\_add(self, second: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. ##### Examples ``` use core::u32::MAX; let x = Simd::from_array([2, 1, 0, MAX]); let max = Simd::splat(MAX); let unsat = x + max; let sat = x.saturating_add(max); assert_eq!(unsat, Simd::from_array([1, 0, MAX, MAX - 1])); assert_eq!(sat, max); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#42)#### fn saturating\_sub(self, second: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. ##### Examples ``` use core::u32::MAX; let x = Simd::from_array([2, 1, 0, MAX]); let max = Simd::splat(MAX); let unsat = x - max; let sat = x.saturating_sub(max); assert_eq!(unsat, Simd::from_array([3, 2, 1, 0])); assert_eq!(sat, Simd::splat(0)); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#45)#### fn reduce\_sum(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#48)#### fn reduce\_product(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#51)#### fn reduce\_max(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#54)#### fn reduce\_min(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#57)#### fn reduce\_and(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#60)#### fn reduce\_or(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#63)#### fn reduce\_xor(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u16 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u64 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = usize
programming_docs
rust Type Definition std::simd::mask16x4 Type Definition std::simd::mask16x4 =================================== ``` pub type mask16x4 = Mask<i16, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with four elements of 16 bits. rust Type Definition std::simd::i32x4 Type Definition std::simd::i32x4 ================================ ``` pub type i32x4 = Simd<i32, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with four elements of type `i32`. rust Type Definition std::simd::i8x16 Type Definition std::simd::i8x16 ================================ ``` pub type i8x16 = Simd<i8, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with 16 elements of type `i8`. rust Type Definition std::simd::mask32x4 Type Definition std::simd::mask32x4 =================================== ``` pub type mask32x4 = Mask<i32, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with four elements of 32 bits. rust Type Definition std::simd::i16x4 Type Definition std::simd::i16x4 ================================ ``` pub type i16x4 = Simd<i16, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with four elements of type `i16`. rust Type Definition std::simd::i8x4 Type Definition std::simd::i8x4 =============================== ``` pub type i8x4 = Simd<i8, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 32-bit SIMD vector with four elements of type `i8`. rust Type Definition std::simd::mask8x16 Type Definition std::simd::mask8x16 =================================== ``` pub type mask8x16 = Mask<i8, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with 16 elements of 8 bits. rust Type Definition std::simd::u8x8 Type Definition std::simd::u8x8 =============================== ``` pub type u8x8 = Simd<u8, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with eight elements of type `u8`. rust Type Definition std::simd::u8x32 Type Definition std::simd::u8x32 ================================ ``` pub type u8x32 = Simd<u8, 32>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with 32 elements of type `u8`. rust Type Definition std::simd::i64x2 Type Definition std::simd::i64x2 ================================ ``` pub type i64x2 = Simd<i64, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with two elements of type `i64`. rust Trait std::simd::SimdElement Trait std::simd::SimdElement ============================ ``` pub unsafe trait SimdElement: Sealed + Copy { type Mask: MaskElement; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Marker trait for types that may be used as SIMD vector elements. Safety ------ This trait, when implemented, asserts the compiler can monomorphize `#[repr(simd)]` structs with the marked type as an element. Strictly, it is valid to impl if the vector will not be miscompiled. Practically, it is user-unfriendly to impl it if the vector won’t compile, even when no soundness guarantees are broken by allowing the user to try. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#657)#### type Mask: MaskElement 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask element type corresponding to this element type. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#733)### impl SimdElement for f32 #### type Mask = i32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#740)### impl SimdElement for f64 #### type Mask = i64 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#698)### impl SimdElement for i8 #### type Mask = i8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#705)### impl SimdElement for i16 #### type Mask = i16 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#712)### impl SimdElement for i32 #### type Mask = i32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#719)### impl SimdElement for i64 #### type Mask = i64 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#726)### impl SimdElement for isize #### type Mask = isize [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#663)### impl SimdElement for u8 #### type Mask = i8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#670)### impl SimdElement for u16 #### type Mask = i16 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#677)### impl SimdElement for u32 #### type Mask = i32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#684)### impl SimdElement for u64 #### type Mask = i64 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#691)### impl SimdElement for usize #### type Mask = isize rust Type Definition std::simd::usizex8 Type Definition std::simd::usizex8 ================================== ``` pub type usizex8 = Simd<usize, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector with eight elements of type `usize`. rust Type Definition std::simd::mask64x2 Type Definition std::simd::mask64x2 =================================== ``` pub type mask64x2 = Mask<i64, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with two elements of 64 bits. rust Trait std::simd::SimdOrd Trait std::simd::SimdOrd ======================== ``` pub trait SimdOrd: SimdPartialOrd { fn simd_max(self, other: Self) -> Self; fn simd_min(self, other: Self) -> Self; fn simd_clamp(self, min: Self, max: Self) -> Self; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Parallel `Ord`. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#26)#### fn simd\_max(self, other: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#30)#### fn simd\_min(self, other: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#41)#### fn simd\_clamp(self, min: Self, max: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. For each lane, returns `max` if `self` is greater than `max`, and `min` if `self` is less than `min`. Otherwise returns `self`. ##### Panics Panics if `min > max` on any lane. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdOrd for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), rust Type Definition std::simd::isizex2 Type Definition std::simd::isizex2 ================================== ``` pub type isizex2 = Simd<isize, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector with two elements of type `isize`. rust Struct std::simd::Simd Struct std::simd::Simd ====================== ``` #[repr(simd)]pub struct Simd<T, const LANES: usize>(_)where    T: SimdElement,    LaneCount<LANES>: SupportedLaneCount; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector of `LANES` elements of type `T`. `Simd<T, N>` has the same shape as [`[T; N]`](../primitive.array), but operates like `T`. Two vectors of the same type and length will, by convention, support the operators (+, \*, etc.) that `T` does. These take the lanes at each index on the left-hand side and right-hand side, perform the operation, and return the result in the same lane in a vector of equal size. For a given operator, this is equivalent to zipping the two arrays together and mapping the operator over each lane. ``` let a0: [i32; 4] = [-2, 0, 2, 4]; let a1 = [10, 9, 8, 7]; let zm_add = a0.zip(a1).map(|(lhs, rhs)| lhs + rhs); let zm_mul = a0.zip(a1).map(|(lhs, rhs)| lhs * rhs); // `Simd<T, N>` implements `From<[T; N]> let (v0, v1) = (Simd::from(a0), Simd::from(a1)); // Which means arrays implement `Into<Simd<T, N>>`. assert_eq!(v0 + v1, zm_add.into()); assert_eq!(v0 * v1, zm_mul.into()); ``` `Simd` with integers has the quirk that these operations are also inherently wrapping, as if `T` was [`Wrapping<T>`](../num/struct.wrapping). Thus, `Simd` does not implement `wrapping_add`, because that is the default behavior. This means there is no warning on overflows, even in “debug” builds. For most applications where `Simd` is appropriate, it is “not a bug” to wrap, and even “debug builds” are unlikely to tolerate the loss of performance. You may want to consider using explicitly checked arithmetic if such is required. Division by zero still causes a panic, so you may want to consider using floating point numbers if that is unacceptable. Layout ------ `Simd<T, N>` has a layout similar to `[T; N]` (identical “shapes”), but with a greater alignment. `[T; N]` is aligned to `T`, but `Simd<T, N>` will have an alignment based on both `T` and `N`. It is thus sound to [`transmute`](../mem/fn.transmute) `Simd<T, N>` to `[T; N]`, and will typically optimize to zero cost, but the reverse transmutation is more likely to require a copy the compiler cannot simply elide. ABI “Features” -------------- Due to Rust’s safety guarantees, `Simd<T, N>` is currently passed to and from functions via memory, not SIMD registers, except as an optimization. `#[inline]` hints are recommended on functions that accept `Simd<T, N>` or return it. The need for this may be corrected in the future. Safe SIMD with Unsafe Rust -------------------------- Operations with `Simd` are typically safe, but there are many reasons to want to combine SIMD with `unsafe` code. Care must be taken to respect differences between `Simd` and other types it may be transformed into or derived from. In particular, the layout of `Simd<T, N>` may be similar to `[T; N]`, and may allow some transmutations, but references to `[T; N]` are not interchangeable with those to `Simd<T, N>`. Thus, when using `unsafe` Rust to read and write `Simd<T, N>` through [raw pointers](../primitive.pointer), it is a good idea to first try with [`read_unaligned`](../primitive.pointer#method.read_unaligned) and [`write_unaligned`](../primitive.pointer#method.write_unaligned). This is because: * [`read`](../primitive.pointer#method.read) and [`write`](../primitive.pointer#method.write) require full alignment (in this case, `Simd<T, N>`’s alignment) * the likely source for reading or destination for writing `Simd<T, N>` is [`[T]`](../primitive.slice) and similar types, aligned to `T` * combining these actions would violate the `unsafe` contract and explode the program into a puff of **undefined behavior** * the compiler can implicitly adjust layouts to make unaligned reads or writes fully aligned if it sees the optimization * most contemporary processors suffer no performance penalty for “unaligned” reads and writes that are aligned at runtime By imposing less obligations, unaligned functions are less likely to make the program unsound, and may be just as fast as stricter alternatives. When trying to guarantee alignment, [`[T]::as_simd`](../primitive.slice#method.as_simd) is an option for converting `[T]` to `[Simd<T, N>]`, and allows soundly operating on an aligned SIMD body, but it may cost more time when handling the scalar head and tail. If these are not sufficient, then it is most ideal to design data structures to be already aligned to the `Simd<T, N>` you wish to use before using `unsafe` Rust to read or write. More conventional ways to compensate for these facts, like materializing `Simd` to or from an array first, are handled by safe methods like [`Simd::from_array`](struct.simd#method.from_array "Simd::from_array") and [`Simd::from_slice`](struct.simd#method.from_slice "Simd::from_slice"). Implementations --------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#186)### impl<T, const LANES: usize> Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#194)#### pub fn reverse(self) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reverse the order of the lanes in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#219)#### pub fn rotate\_lanes\_left<const OFFSET: usize>(self) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Rotates the vector such that the first `OFFSET` elements of the slice move to the end while the last `LANES - OFFSET` elements move to the front. After calling `rotate_lanes_left`, the element previously in lane `OFFSET` will become the first element in the slice. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#245)#### pub fn rotate\_lanes\_right<const OFFSET: usize>(self) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Rotates the vector such that the first `LANES - OFFSET` elements of the vector move to the end while the last `OFFSET` elements move to the front. After calling `rotate_lanes_right`, the element previously at index `LANES - OFFSET` will become the first element in the slice. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#287)#### pub fn interleave( self, other: Simd<T, LANES>) -> (Simd<T, LANES>, Simd<T, LANES>) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Interleave two vectors. Produces two vectors with lanes taken alternately from `self` and `other`. The first result contains the first `LANES / 2` lanes from `self` and `other`, alternating, starting with the first lane of `self`. The second result contains the last `LANES / 2` lanes from `self` and `other`, alternating, starting with the lane `LANES / 2` from the start of `self`. ``` #![feature(portable_simd)] let a = Simd::from_array([0, 1, 2, 3]); let b = Simd::from_array([4, 5, 6, 7]); let (x, y) = a.interleave(b); assert_eq!(x.to_array(), [0, 4, 1, 5]); assert_eq!(y.to_array(), [2, 6, 3, 7]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#350)#### pub fn deinterleave( self, other: Simd<T, LANES>) -> (Simd<T, LANES>, Simd<T, LANES>) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Deinterleave two vectors. The first result takes every other lane of `self` and then `other`, starting with the first lane. The second result takes every other lane of `self` and then `other`, starting with the second lane. ``` #![feature(portable_simd)] let a = Simd::from_array([0, 4, 1, 5]); let b = Simd::from_array([2, 6, 3, 7]); let (x, y) = a.deinterleave(b); assert_eq!(x.to_array(), [0, 1, 2, 3]); assert_eq!(y.to_array(), [4, 5, 6, 7]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#95)### impl<T, const LANES: usize> Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#101)#### pub const LANES: usize = LANES 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Number of lanes in this vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#113)#### pub const fn lanes(&self) -> usize 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the number of lanes in this SIMD vector. ##### Examples ``` let v = u32x4::splat(0); assert_eq!(v.lanes(), 4); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#127)#### pub fn splat(value: T) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Constructs a new SIMD vector with all lanes set to the given value. ##### Examples ``` let v = u32x4::splat(8); assert_eq!(v.as_array(), &[8, 8, 8, 8]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#147)#### pub const fn as\_array(&self) -> &[T; LANES] 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns an array reference containing the entire SIMD vector. ##### Examples ``` let v: u64x4 = Simd::from_array([0, 1, 2, 3]); assert_eq!(v.as_array(), &[0, 1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#152)#### pub fn as\_mut\_array(&mut self) -> &mut [T; LANES] 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns a mutable array reference containing the entire SIMD vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#157)#### pub const fn from\_array(array: [T; LANES]) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts an array to a SIMD vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#162)#### pub const fn to\_array(self) -> [T; LANES] 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a SIMD vector to an array. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#182)#### pub const fn from\_slice(slice: &[T]) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts a slice to a SIMD vector containing `slice[..LANES]`. ##### Panics Panics if the slice’s length is less than the vector’s `Simd::LANES`. ##### Examples ``` let source = vec![1, 2, 3, 4, 5, 6]; let v = u32x4::from_slice(&source); assert_eq!(v.as_array(), &[1, 2, 3, 4]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#218)#### pub fn cast<U>(self) -> Simd<U, LANES>where U: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Performs lanewise conversion of a SIMD vector’s elements to another SIMD-valid type. This follows the semantics of Rust’s `as` conversion for casting integers to unsigned integers (interpreting as the other type, so `-1` to `MAX`), and from floats to integers (truncating, or saturating at the limits) for each lane, or vice versa. ##### Examples ``` let floats: Simd<f32, 4> = Simd::from_array([1.9, -4.5, f32::INFINITY, f32::NAN]); let ints = floats.cast::<i32>(); assert_eq!(ints, Simd::from_array([1, -4, i32::MAX, 0])); // Formally equivalent, but `Simd::cast` can optimize better. assert_eq!(ints, Simd::from_array(floats.to_array().map(|x| x as i32))); // The float conversion does not round-trip. let floats_again = ints.cast(); assert_ne!(floats, floats_again); assert_eq!(floats_again, Simd::from_array([1.0, -4.0, 2147483647.0, 0.0])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#238-241)#### pub unsafe fn to\_int\_unchecked<I>(self) -> Simd<I, LANES>where T: [FloatToInt](../convert/trait.floattoint "trait std::convert::FloatToInt")<I>, I: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Rounds toward zero and converts to the same-width integer type, assuming that the value is finite and fits in that type. ##### Safety The value must: * Not be NaN * Not be infinite * Be representable in the return type, after truncating off its fractional part If these requirements are infeasible or costly, consider using the safe function [cast](struct.simd#method.cast), which saturates on conversion. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#264)#### pub fn gather\_or( slice: &[T], idxs: Simd<usize, LANES>, or: Simd<T, LANES>) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reads from potentially discontiguous indices in `slice` to construct a SIMD vector. If an index is out-of-bounds, the lane is instead selected from the `or` vector. ##### Examples ``` let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 5]); let alt = Simd::from_array([-5, -4, -3, -2]); let result = Simd::gather_or(&vec, idxs, alt); // Note the lane that is out-of-bounds. assert_eq!(result, Simd::from_array([-5, 13, 10, 15])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#283-285)#### pub fn gather\_or\_default(slice: &[T], idxs: Simd<usize, LANES>) -> Simd<T, LANES>where T: [Default](../default/trait.default "trait std::default::Default"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reads from potentially discontiguous indices in `slice` to construct a SIMD vector. If an index is out-of-bounds, the lane is set to the default value for the type. ##### Examples ``` let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 5]); let result = Simd::gather_or_default(&vec, idxs); // Note the lane that is out-of-bounds. assert_eq!(result, Simd::from_array([0, 13, 10, 15])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#308-313)#### pub fn gather\_select( slice: &[T], enable: Mask<isize, LANES>, idxs: Simd<usize, LANES>, or: Simd<T, LANES>) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reads from potentially discontiguous indices in `slice` to construct a SIMD vector. The mask `enable`s all `true` lanes and disables all `false` lanes. If an index is disabled or is out-of-bounds, the lane is selected from the `or` vector. ##### Examples ``` let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 5]); let alt = Simd::from_array([-5, -4, -3, -2]); let enable = Mask::from_array([true, true, true, false]); // Note the mask of the last lane. let result = Simd::gather_select(&vec, enable, idxs, alt); // Note the lane that is out-of-bounds. assert_eq!(result, Simd::from_array([-5, 13, 10, -2])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#348-353)#### pub unsafe fn gather\_select\_unchecked( slice: &[T], enable: Mask<isize, LANES>, idxs: Simd<usize, LANES>, or: Simd<T, LANES>) -> Simd<T, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reads from potentially discontiguous indices in `slice` to construct a SIMD vector. The mask `enable`s all `true` lanes and disables all `false` lanes. If an index is disabled, the lane is selected from the `or` vector. ##### Safety Calling this function with an `enable`d out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting value is not used. ##### Examples ``` let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 5]); let alt = Simd::from_array([-5, -4, -3, -2]); let enable = Mask::from_array([true, true, true, false]); // Note the final mask lane. // If this mask was used to gather, it would be unsound. Let's fix that. let enable = enable & idxs.simd_lt(Simd::splat(vec.len())); // We have masked the OOB lane, so it's safe to gather now. let result = unsafe { Simd::gather_select_unchecked(&vec, enable, idxs, alt) }; assert_eq!(result, Simd::from_array([-5, 13, 10, -2])); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#377)#### pub fn scatter(self, slice: &mut [T], idxs: Simd<usize, LANES>) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Writes the values in a SIMD vector to potentially discontiguous indices in `slice`. If two lanes in the scattered vector would write to the same index only the last lane is guaranteed to actually be written. ##### Examples ``` let mut vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 0]); let vals = Simd::from_array([-27, 82, -41, 124]); vals.scatter(&mut vec, idxs); // index 0 receives two writes. assert_eq!(vec, vec![124, 11, 12, 82, 14, 15, 16, 17, 18]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#402-407)#### pub fn scatter\_select( self, slice: &mut [T], enable: Mask<isize, LANES>, idxs: Simd<usize, LANES>) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Writes the values in a SIMD vector to multiple potentially discontiguous indices in `slice`. The mask `enable`s all `true` lanes and disables all `false` lanes. If an enabled index is out-of-bounds, the lane is not written. If two enabled lanes in the scattered vector would write to the same index, only the last lane is guaranteed to actually be written. ##### Examples ``` let mut vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 0]); let vals = Simd::from_array([-27, 82, -41, 124]); let enable = Mask::from_array([true, true, true, false]); // Note the mask of the last lane. vals.scatter_select(&mut vec, enable, idxs); // index 0's second write is masked, thus omitted. assert_eq!(vec, vec![-41, 11, 12, 82, 14, 15, 16, 17, 18]); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#443-448)#### pub unsafe fn scatter\_select\_unchecked( self, slice: &mut [T], enable: Mask<isize, LANES>, idxs: Simd<usize, LANES>) 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Writes the values in a SIMD vector to multiple potentially discontiguous indices in `slice`. The mask `enable`s all `true` lanes and disables all `false` lanes. If two enabled lanes in the scattered vector would write to the same index, only the last lane is guaranteed to actually be written. ##### Safety Calling this function with an enabled out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)*, and may lead to memory corruption. ##### Examples ``` let mut vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18]; let idxs = Simd::from_array([9, 3, 0, 0]); let vals = Simd::from_array([-27, 82, -41, 124]); let enable = Mask::from_array([true, true, true, false]); // Note the mask of the last lane. // If this mask was used to scatter, it would be unsound. Let's fix that. let enable = enable & idxs.simd_lt(Simd::splat(vec.len())); // We have masked the OOB lane, so it's safe to scatter now. unsafe { vals.scatter_select_unchecked(&mut vec, enable, idxs); } // index 0's second write is masked, thus was omitted. assert_eq!(vec, vec![-41, 11, 12, 82, 14, 15, 16, 17, 18]); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Add<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Add](../ops/trait.add "trait std::ops::Add")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Add](../ops/trait.add "trait std::ops::Add")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn add( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Add<&'rhs Simd<T, LANES>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Add<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Add](../ops/trait.add "trait std::ops::Add")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Add](../ops/trait.add "trait std::ops::Add")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn add( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Add<&Simd<T, LANES>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Add<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Add](../ops/trait.add "trait std::ops::Add")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Add](../ops/trait.add "trait std::ops::Add")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn add( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Add<Simd<T, LANES>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Add<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn add(self, rhs: Simd<f32, N>) -> <Simd<f32, N> as Add<Simd<f32, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Add<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn add(self, rhs: Simd<f64, N>) -> <Simd<f64, N> as Add<Simd<f64, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Add<Simd<i16, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Add<Simd<i32, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Add<Simd<i64, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Add<Simd<i8, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Add<Simd<isize, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Add<Simd<u16, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Add<Simd<u32, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Add<Simd<u64, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Add<Simd<u8, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn add( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Add<Simd<usize, N>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> AddAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Add](../ops/trait.add "trait std::ops::Add")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Add](../ops/trait.add "trait std::ops::Add")<U>>::[Output](../ops/trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn add\_assign(&mut self, rhs: U) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#587)### impl<T, const LANES: usize> AsMut<[T; LANES]> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#593)#### fn as\_mut(&mut self) -> &mut [T; LANES] Converts this type into a mutable reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#610)### impl<T, const LANES: usize> AsMut<[T]> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#616)#### fn as\_mut(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this type into a mutable reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#576)### impl<T, const LANES: usize> AsRef<[T; LANES]> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#582)#### fn as\_ref(&self) -> &[T; LANES] Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#599)### impl<T, const LANES: usize> AsRef<[T]> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#605)#### fn as\_ref(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> Binary for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Binary](../fmt/trait.binary "trait std::fmt::Binary"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> BitAnd<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitand( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as BitAnd<&'rhs Simd<T, LANES>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitAnd<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitand( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as BitAnd<&Simd<T, LANES>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitAnd<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitand( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as BitAnd<Simd<T, LANES>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<i16, N>) -> <Simd<i16, N> as BitAnd<Simd<i16, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<i32, N>) -> <Simd<i32, N> as BitAnd<Simd<i32, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<i64, N>) -> <Simd<i64, N> as BitAnd<Simd<i64, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as BitAnd<Simd<i8, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as BitAnd<Simd<isize, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<u16, N>) -> <Simd<u16, N> as BitAnd<Simd<u16, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<u32, N>) -> <Simd<u32, N> as BitAnd<Simd<u32, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<u64, N>) -> <Simd<u64, N> as BitAnd<Simd<u64, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as BitAnd<Simd<u8, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitand( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as BitAnd<Simd<usize, N>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> BitAndAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](../ops/trait.bitand "trait std::ops::BitAnd")<U>>::[Output](../ops/trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn bitand\_assign(&mut self, rhs: U) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> BitOr<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitor( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as BitOr<&'rhs Simd<T, LANES>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitOr<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitor( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as BitOr<&Simd<T, LANES>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitOr<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitor( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as BitOr<Simd<T, LANES>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<i16, N>) -> <Simd<i16, N> as BitOr<Simd<i16, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<i32, N>) -> <Simd<i32, N> as BitOr<Simd<i32, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<i64, N>) -> <Simd<i64, N> as BitOr<Simd<i64, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as BitOr<Simd<i8, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as BitOr<Simd<isize, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<u16, N>) -> <Simd<u16, N> as BitOr<Simd<u16, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<u32, N>) -> <Simd<u32, N> as BitOr<Simd<u32, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<u64, N>) -> <Simd<u64, N> as BitOr<Simd<u64, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as BitOr<Simd<u8, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitor( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as BitOr<Simd<usize, N>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> BitOrAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](../ops/trait.bitor "trait std::ops::BitOr")<U>>::[Output](../ops/trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn bitor\_assign(&mut self, rhs: U) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> BitXor<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitxor( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as BitXor<&'rhs Simd<T, LANES>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitXor<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitxor( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as BitXor<&Simd<T, LANES>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitXor<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn bitxor( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as BitXor<Simd<T, LANES>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<i16, N>) -> <Simd<i16, N> as BitXor<Simd<i16, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<i32, N>) -> <Simd<i32, N> as BitXor<Simd<i32, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<i64, N>) -> <Simd<i64, N> as BitXor<Simd<i64, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as BitXor<Simd<i8, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as BitXor<Simd<isize, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<u16, N>) -> <Simd<u16, N> as BitXor<Simd<u16, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<u32, N>) -> <Simd<u32, N> as BitXor<Simd<u32, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<u64, N>) -> <Simd<u64, N> as BitXor<Simd<u64, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as BitXor<Simd<u8, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn bitxor( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as BitXor<Simd<usize, N>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> BitXorAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](../ops/trait.bitxor "trait std::ops::BitXor")<U>>::[Output](../ops/trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn bitxor\_assign(&mut self, rhs: U) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#478)### impl<T, const LANES: usize> Clone for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#483)#### fn clone(&self) -> Simd<T, LANES> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> Debug for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#488)### impl<T, const LANES: usize> Default for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Default](../default/trait.default "trait std::default::Default"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#494)#### fn default() -> Simd<T, LANES> Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Div<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Div](../ops/trait.div "trait std::ops::Div")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Div](../ops/trait.div "trait std::ops::Div")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn div( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Div<&'rhs Simd<T, LANES>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Div<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Div](../ops/trait.div "trait std::ops::Div")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Div](../ops/trait.div "trait std::ops::Div")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn div( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Div<&Simd<T, LANES>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Div<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Div](../ops/trait.div "trait std::ops::Div")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Div](../ops/trait.div "trait std::ops::Div")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn div( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Div<Simd<T, LANES>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Div<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn div(self, rhs: Simd<f32, N>) -> <Simd<f32, N> as Div<Simd<f32, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Div<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn div(self, rhs: Simd<f64, N>) -> <Simd<f64, N> as Div<Simd<f64, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Div<Simd<i16, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Div<Simd<i32, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Div<Simd<i64, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Div<Simd<i8, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Div<Simd<isize, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Div<Simd<u16, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Div<Simd<u32, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Div<Simd<u64, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Div<Simd<u8, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn div( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Div<Simd<usize, N>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> DivAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Div](../ops/trait.div "trait std::ops::Div")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Div](../ops/trait.div "trait std::ops::Div")<U>>::[Output](../ops/trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn div\_assign(&mut self, rhs: U) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#622)### impl<T, const LANES: usize> From<[T; LANES]> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#627)#### fn from(array: [T; LANES]) -> Simd<T, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/full_masks.rs.html#260)### impl<T, const LANES: usize> From<Mask<T, LANES>> for Simd<T, LANES>where T: [MaskElement](trait.maskelement "trait std::simd::MaskElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks/full_masks.rs.html#265)#### fn from(value: Mask<T, LANES>) -> Simd<T, LANES> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#632)### impl<T, const LANES: usize> From<Simd<T, LANES>> for [T; LANES]where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#637)#### fn from(vector: Simd<T, LANES>) -> [T; LANES] Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#31)### impl From<Simd<f32, 16>> for \_\_m512 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#31)#### fn from(value: Simd<f32, 16>) -> \_\_m512 Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#29)### impl From<Simd<f32, 4>> for \_\_m128 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#29)#### fn from(value: Simd<f32, 4>) -> \_\_m128 Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#30)### impl From<Simd<f32, 8>> for \_\_m256 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#30)#### fn from(value: Simd<f32, 8>) -> \_\_m256 Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#39)### impl From<Simd<f64, 2>> for \_\_m128d [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#39)#### fn from(value: Simd<f64, 2>) -> \_\_m128d Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#40)### impl From<Simd<f64, 4>> for \_\_m256d [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#40)#### fn from(value: Simd<f64, 4>) -> \_\_m256d Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#41)### impl From<Simd<f64, 8>> for \_\_m512d [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#41)#### fn from(value: Simd<f64, 8>) -> \_\_m512d Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#20)### impl From<Simd<i16, 16>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#20)#### fn from(value: Simd<i16, 16>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#21)### impl From<Simd<i16, 32>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#21)#### fn from(value: Simd<i16, 32>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#19)### impl From<Simd<i16, 8>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#19)#### fn from(value: Simd<i16, 8>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#28)### impl From<Simd<i32, 16>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#28)#### fn from(value: Simd<i32, 16>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#26)### impl From<Simd<i32, 4>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#26)#### fn from(value: Simd<i32, 4>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#27)### impl From<Simd<i32, 8>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#27)#### fn from(value: Simd<i32, 8>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#36)### impl From<Simd<i64, 2>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#36)#### fn from(value: Simd<i64, 2>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#37)### impl From<Simd<i64, 4>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#37)#### fn from(value: Simd<i64, 4>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#38)### impl From<Simd<i64, 8>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#38)#### fn from(value: Simd<i64, 8>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#12)### impl From<Simd<i8, 16>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#12)#### fn from(value: Simd<i8, 16>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#13)### impl From<Simd<i8, 32>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#13)#### fn from(value: Simd<i8, 32>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#14)### impl From<Simd<i8, 64>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#14)#### fn from(value: Simd<i8, 64>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#60)### impl From<Simd<isize, 2>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#60)#### fn from(value: Simd<isize, 2>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#61)### impl From<Simd<isize, 4>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#61)#### fn from(value: Simd<isize, 4>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#62)### impl From<Simd<isize, 8>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#62)#### fn from(value: Simd<isize, 8>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#17)### impl From<Simd<u16, 16>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#17)#### fn from(value: Simd<u16, 16>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#18)### impl From<Simd<u16, 32>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#18)#### fn from(value: Simd<u16, 32>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#16)### impl From<Simd<u16, 8>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#16)#### fn from(value: Simd<u16, 8>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#25)### impl From<Simd<u32, 16>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#25)#### fn from(value: Simd<u32, 16>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#23)### impl From<Simd<u32, 4>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#23)#### fn from(value: Simd<u32, 4>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#24)### impl From<Simd<u32, 8>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#24)#### fn from(value: Simd<u32, 8>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#33)### impl From<Simd<u64, 2>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#33)#### fn from(value: Simd<u64, 2>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#34)### impl From<Simd<u64, 4>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#34)#### fn from(value: Simd<u64, 4>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#35)### impl From<Simd<u64, 8>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#35)#### fn from(value: Simd<u64, 8>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#9)### impl From<Simd<u8, 16>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#9)#### fn from(value: Simd<u8, 16>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#10)### impl From<Simd<u8, 32>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#10)#### fn from(value: Simd<u8, 32>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#11)### impl From<Simd<u8, 64>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#11)#### fn from(value: Simd<u8, 64>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#57)### impl From<Simd<usize, 2>> for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#57)#### fn from(value: Simd<usize, 2>) -> \_\_m128i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#58)### impl From<Simd<usize, 4>> for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#58)#### fn from(value: Simd<usize, 4>) -> \_\_m256i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#59)### impl From<Simd<usize, 8>> for \_\_m512i [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#59)#### fn from(value: Simd<usize, 8>) -> \_\_m512i Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#29)### impl From<\_\_m128> for Simd<f32, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#29)#### fn from(value: \_\_m128) -> Simd<f32, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#39)### impl From<\_\_m128d> for Simd<f64, 2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#39)#### fn from(value: \_\_m128d) -> Simd<f64, 2> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#19)### impl From<\_\_m128i> for Simd<i16, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#19)#### fn from(value: \_\_m128i) -> Simd<i16, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#26)### impl From<\_\_m128i> for Simd<i32, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#26)#### fn from(value: \_\_m128i) -> Simd<i32, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#36)### impl From<\_\_m128i> for Simd<i64, 2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#36)#### fn from(value: \_\_m128i) -> Simd<i64, 2> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#12)### impl From<\_\_m128i> for Simd<i8, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#12)#### fn from(value: \_\_m128i) -> Simd<i8, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#60)### impl From<\_\_m128i> for Simd<isize, 2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#60)#### fn from(value: \_\_m128i) -> Simd<isize, 2> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#16)### impl From<\_\_m128i> for Simd<u16, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#16)#### fn from(value: \_\_m128i) -> Simd<u16, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#23)### impl From<\_\_m128i> for Simd<u32, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#23)#### fn from(value: \_\_m128i) -> Simd<u32, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#33)### impl From<\_\_m128i> for Simd<u64, 2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#33)#### fn from(value: \_\_m128i) -> Simd<u64, 2> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#9)### impl From<\_\_m128i> for Simd<u8, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#9)#### fn from(value: \_\_m128i) -> Simd<u8, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#57)### impl From<\_\_m128i> for Simd<usize, 2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#57)#### fn from(value: \_\_m128i) -> Simd<usize, 2> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#30)### impl From<\_\_m256> for Simd<f32, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#30)#### fn from(value: \_\_m256) -> Simd<f32, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#40)### impl From<\_\_m256d> for Simd<f64, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#40)#### fn from(value: \_\_m256d) -> Simd<f64, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#20)### impl From<\_\_m256i> for Simd<i16, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#20)#### fn from(value: \_\_m256i) -> Simd<i16, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#27)### impl From<\_\_m256i> for Simd<i32, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#27)#### fn from(value: \_\_m256i) -> Simd<i32, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#37)### impl From<\_\_m256i> for Simd<i64, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#37)#### fn from(value: \_\_m256i) -> Simd<i64, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#13)### impl From<\_\_m256i> for Simd<i8, 32> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#13)#### fn from(value: \_\_m256i) -> Simd<i8, 32> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#61)### impl From<\_\_m256i> for Simd<isize, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#61)#### fn from(value: \_\_m256i) -> Simd<isize, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#17)### impl From<\_\_m256i> for Simd<u16, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#17)#### fn from(value: \_\_m256i) -> Simd<u16, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#24)### impl From<\_\_m256i> for Simd<u32, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#24)#### fn from(value: \_\_m256i) -> Simd<u32, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#34)### impl From<\_\_m256i> for Simd<u64, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#34)#### fn from(value: \_\_m256i) -> Simd<u64, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#10)### impl From<\_\_m256i> for Simd<u8, 32> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#10)#### fn from(value: \_\_m256i) -> Simd<u8, 32> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#58)### impl From<\_\_m256i> for Simd<usize, 4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#58)#### fn from(value: \_\_m256i) -> Simd<usize, 4> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#31)### impl From<\_\_m512> for Simd<f32, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#31)#### fn from(value: \_\_m512) -> Simd<f32, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#41)### impl From<\_\_m512d> for Simd<f64, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#41)#### fn from(value: \_\_m512d) -> Simd<f64, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#21)### impl From<\_\_m512i> for Simd<i16, 32> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#21)#### fn from(value: \_\_m512i) -> Simd<i16, 32> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#28)### impl From<\_\_m512i> for Simd<i32, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#28)#### fn from(value: \_\_m512i) -> Simd<i32, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#38)### impl From<\_\_m512i> for Simd<i64, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#38)#### fn from(value: \_\_m512i) -> Simd<i64, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#14)### impl From<\_\_m512i> for Simd<i8, 64> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#14)#### fn from(value: \_\_m512i) -> Simd<i8, 64> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#62)### impl From<\_\_m512i> for Simd<isize, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#62)#### fn from(value: \_\_m512i) -> Simd<isize, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#18)### impl From<\_\_m512i> for Simd<u16, 32> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#18)#### fn from(value: \_\_m512i) -> Simd<u16, 32> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#25)### impl From<\_\_m512i> for Simd<u32, 16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#25)#### fn from(value: \_\_m512i) -> Simd<u32, 16> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#35)### impl From<\_\_m512i> for Simd<u64, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#35)#### fn from(value: \_\_m512i) -> Simd<u64, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#11)### impl From<\_\_m512i> for Simd<u8, 64> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#11)#### fn from(value: \_\_m512i) -> Simd<u8, 64> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#59)### impl From<\_\_m512i> for Simd<usize, 8> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vendor/x86.rs.html#59)#### fn from(value: \_\_m512i) -> Simd<usize, 8> Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#561)### impl<T, const LANES: usize> Hash for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Hash](../hash/trait.hash "trait std::hash::Hash"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#567-569)#### fn hash<H>(&self, state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#11)### impl<I, T, const LANES: usize> Index<I> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = <I as SliceIndex<[T]>>::Output The returned type after indexing. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#18)#### fn index(&self, index: I) -> &<Simd<T, LANES> as Index<I>>::Output Performs the indexing (`container[index]`) operation. [Read more](../ops/trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#23)### impl<I, T, const LANES: usize> IndexMut<I> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#29)#### fn index\_mut(&mut self, index: I) -> &mut <Simd<T, LANES> as Index<I>>::Output Performs the mutable indexing (`container[index]`) operation. [Read more](../ops/trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> LowerExp for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [LowerExp](../fmt/trait.lowerexp "trait std::fmt::LowerExp"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> LowerHex for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [LowerHex](../fmt/trait.lowerhex "trait std::fmt::LowerHex"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Mul<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](../ops/trait.mul "trait std::ops::Mul")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](../ops/trait.mul "trait std::ops::Mul")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn mul( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Mul<&'rhs Simd<T, LANES>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Mul<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](../ops/trait.mul "trait std::ops::Mul")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](../ops/trait.mul "trait std::ops::Mul")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn mul( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Mul<&Simd<T, LANES>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Mul<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](../ops/trait.mul "trait std::ops::Mul")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](../ops/trait.mul "trait std::ops::Mul")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn mul( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Mul<Simd<T, LANES>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Mul<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn mul(self, rhs: Simd<f32, N>) -> <Simd<f32, N> as Mul<Simd<f32, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Mul<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn mul(self, rhs: Simd<f64, N>) -> <Simd<f64, N> as Mul<Simd<f64, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Mul<Simd<i16, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Mul<Simd<i32, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Mul<Simd<i64, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Mul<Simd<i8, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Mul<Simd<isize, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Mul<Simd<u16, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Mul<Simd<u32, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Mul<Simd<u64, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Mul<Simd<u8, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn mul( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Mul<Simd<usize, N>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> MulAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](../ops/trait.mul "trait std::ops::Mul")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](../ops/trait.mul "trait std::ops::Mul")<U>>::[Output](../ops/trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn mul\_assign(&mut self, rhs: U) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<f32, LANES>where [f32](../primitive.f32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<f32, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<f64, LANES>where [f64](../primitive.f64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<f64, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i16, LANES>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<i16, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i32, LANES>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<i32, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i64, LANES>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<i64, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i8, LANES>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<i8, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<isize, LANES>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)#### fn neg(self) -> <Simd<isize, LANES> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i16, LANES>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<i16, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i32, LANES>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<i32, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i64, LANES>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<i64, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i8, LANES>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<i8, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<isize, LANES>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<isize, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u16, LANES>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<u16, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u32, LANES>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<u32, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u64, LANES>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<u64, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u8, LANES>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<u8, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<usize, LANES>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, LANES> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)#### fn not(self) -> <Simd<usize, LANES> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> Octal for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Octal](../fmt/trait.octal "trait std::fmt::Octal"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#549)### impl<T, const LANES: usize> Ord for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#555)#### fn cmp(&self, other: &Simd<T, LANES>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#499)### impl<T, const LANES: usize> PartialEq<Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#505)#### fn eq(&self, other: &Simd<T, LANES>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#518)#### fn ne(&self, other: &Simd<T, LANES>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#530)### impl<T, const LANES: usize> PartialOrd<Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#536)#### fn partial\_cmp(&self, other: &Simd<T, LANES>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)### impl<'a, const LANES: usize> Product<&'a Simd<f32, LANES>> for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)#### fn product<I>(iter: I) -> Simd<f32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[f32](../primitive.f32), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)### impl<'a, const LANES: usize> Product<&'a Simd<f64, LANES>> for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)#### fn product<I>(iter: I) -> Simd<f64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[f64](../primitive.f64), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)### impl<'a, const LANES: usize> Product<&'a Simd<i16, LANES>> for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)#### fn product<I>(iter: I) -> Simd<i16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i16](../primitive.i16), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)### impl<'a, const LANES: usize> Product<&'a Simd<i32, LANES>> for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)#### fn product<I>(iter: I) -> Simd<i32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i32](../primitive.i32), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)### impl<'a, const LANES: usize> Product<&'a Simd<i64, LANES>> for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)#### fn product<I>(iter: I) -> Simd<i64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i64](../primitive.i64), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)### impl<'a, const LANES: usize> Product<&'a Simd<i8, LANES>> for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)#### fn product<I>(iter: I) -> Simd<i8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i8](../primitive.i8), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)### impl<'a, const LANES: usize> Product<&'a Simd<isize, LANES>> for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)#### fn product<I>(iter: I) -> Simd<isize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[isize](../primitive.isize), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)### impl<'a, const LANES: usize> Product<&'a Simd<u16, LANES>> for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)#### fn product<I>(iter: I) -> Simd<u16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u16](../primitive.u16), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)### impl<'a, const LANES: usize> Product<&'a Simd<u32, LANES>> for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)#### fn product<I>(iter: I) -> Simd<u32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u32](../primitive.u32), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)### impl<'a, const LANES: usize> Product<&'a Simd<u64, LANES>> for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)#### fn product<I>(iter: I) -> Simd<u64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u64](../primitive.u64), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)### impl<'a, const LANES: usize> Product<&'a Simd<u8, LANES>> for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)#### fn product<I>(iter: I) -> Simd<u8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u8](../primitive.u8), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)### impl<'a, const LANES: usize> Product<&'a Simd<usize, LANES>> for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)#### fn product<I>(iter: I) -> Simd<usize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[usize](../primitive.usize), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)### impl<const LANES: usize> Product<Simd<f32, LANES>> for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)#### fn product<I>(iter: I) -> Simd<f32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[f32](../primitive.f32), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)### impl<const LANES: usize> Product<Simd<f64, LANES>> for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)#### fn product<I>(iter: I) -> Simd<f64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[f64](../primitive.f64), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)### impl<const LANES: usize> Product<Simd<i16, LANES>> for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)#### fn product<I>(iter: I) -> Simd<i16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i16](../primitive.i16), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)### impl<const LANES: usize> Product<Simd<i32, LANES>> for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)#### fn product<I>(iter: I) -> Simd<i32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i32](../primitive.i32), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)### impl<const LANES: usize> Product<Simd<i64, LANES>> for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)#### fn product<I>(iter: I) -> Simd<i64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i64](../primitive.i64), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)### impl<const LANES: usize> Product<Simd<i8, LANES>> for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)#### fn product<I>(iter: I) -> Simd<i8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i8](../primitive.i8), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)### impl<const LANES: usize> Product<Simd<isize, LANES>> for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)#### fn product<I>(iter: I) -> Simd<isize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[isize](../primitive.isize), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)### impl<const LANES: usize> Product<Simd<u16, LANES>> for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)#### fn product<I>(iter: I) -> Simd<u16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u16](../primitive.u16), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)### impl<const LANES: usize> Product<Simd<u32, LANES>> for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)#### fn product<I>(iter: I) -> Simd<u32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u32](../primitive.u32), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)### impl<const LANES: usize> Product<Simd<u64, LANES>> for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)#### fn product<I>(iter: I) -> Simd<u64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u64](../primitive.u64), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)### impl<const LANES: usize> Product<Simd<u8, LANES>> for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)#### fn product<I>(iter: I) -> Simd<u8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u8](../primitive.u8), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)### impl<const LANES: usize> Product<Simd<usize, LANES>> for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)#### fn product<I>(iter: I) -> Simd<usize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[usize](../primitive.usize), LANES>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Rem<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](../ops/trait.rem "trait std::ops::Rem")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](../ops/trait.rem "trait std::ops::Rem")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn rem( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Rem<&'rhs Simd<T, LANES>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Rem<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](../ops/trait.rem "trait std::ops::Rem")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](../ops/trait.rem "trait std::ops::Rem")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn rem( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Rem<&Simd<T, LANES>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Rem<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](../ops/trait.rem "trait std::ops::Rem")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](../ops/trait.rem "trait std::ops::Rem")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn rem( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Rem<Simd<T, LANES>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Rem<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn rem(self, rhs: Simd<f32, N>) -> <Simd<f32, N> as Rem<Simd<f32, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Rem<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn rem(self, rhs: Simd<f64, N>) -> <Simd<f64, N> as Rem<Simd<f64, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Rem<Simd<i16, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Rem<Simd<i32, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Rem<Simd<i64, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Rem<Simd<i8, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Rem<Simd<isize, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Rem<Simd<u16, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Rem<Simd<u32, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Rem<Simd<u64, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Rem<Simd<u8, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn rem( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Rem<Simd<usize, N>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> RemAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](../ops/trait.rem "trait std::ops::Rem")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](../ops/trait.rem "trait std::ops::Rem")<U>>::[Output](../ops/trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn rem\_assign(&mut self, rhs: U) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Shl<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](../ops/trait.shl "trait std::ops::Shl")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](../ops/trait.shl "trait std::ops::Shl")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn shl( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Shl<&'rhs Simd<T, LANES>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shl<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](../ops/trait.shl "trait std::ops::Shl")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](../ops/trait.shl "trait std::ops::Shl")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn shl( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Shl<&Simd<T, LANES>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shl<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](../ops/trait.shl "trait std::ops::Shl")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](../ops/trait.shl "trait std::ops::Shl")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn shl( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Shl<Simd<T, LANES>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Shl<Simd<i16, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Shl<Simd<i32, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Shl<Simd<i64, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Shl<Simd<i8, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Shl<Simd<isize, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Shl<Simd<u16, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Shl<Simd<u32, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Shl<Simd<u64, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Shl<Simd<u8, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shl( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Shl<Simd<usize, N>>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> ShlAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](../ops/trait.shl "trait std::ops::Shl")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](../ops/trait.shl "trait std::ops::Shl")<U>>::[Output](../ops/trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn shl\_assign(&mut self, rhs: U) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Shr<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](../ops/trait.shr "trait std::ops::Shr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](../ops/trait.shr "trait std::ops::Shr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn shr( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Shr<&'rhs Simd<T, LANES>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shr<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](../ops/trait.shr "trait std::ops::Shr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](../ops/trait.shr "trait std::ops::Shr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn shr( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Shr<&Simd<T, LANES>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shr<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](../ops/trait.shr "trait std::ops::Shr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](../ops/trait.shr "trait std::ops::Shr")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn shr( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Shr<Simd<T, LANES>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Shr<Simd<i16, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Shr<Simd<i32, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Shr<Simd<i64, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Shr<Simd<i8, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Shr<Simd<isize, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Shr<Simd<u16, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Shr<Simd<u32, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Shr<Simd<u64, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Shr<Simd<u8, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn shr( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Shr<Simd<usize, N>>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> ShrAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](../ops/trait.shr "trait std::ops::Shr")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](../ops/trait.shr "trait std::ops::Shr")<U>>::[Output](../ops/trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn shr\_assign(&mut self, rhs: U) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)### impl<const LANES: usize> SimdFloat for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i32 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = f32 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. #### type Bits = Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Bit representation of this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn to\_bits(self) -> Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Raw transmutation to an unsigned integer vector type with the same size and number of lanes. [Read more](trait.simdfloat#tymethod.to_bits) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn from\_bits(bits: Simd<u32, LANES>) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Raw transmutation from an unsigned integer vector type with the same size and number of lanes. [Read more](trait.simdfloat#tymethod.from_bits) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn abs(self) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Produces a vector where every lane has the absolute value of the equivalently-indexed lane in `self`. [Read more](trait.simdfloat#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn recip(self) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Takes the reciprocal (inverse) of each lane, `1/x`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn to\_degrees(self) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts each lane from radians to degrees. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn to\_radians(self) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts each lane from degrees to radians. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_sign\_positive(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if it has a positive sign, including `+0.0`, `NaN`s with positive sign bit and positive infinity. [Read more](trait.simdfloat#tymethod.is_sign_positive) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_sign\_negative(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if it has a negative sign, including `-0.0`, `NaN`s with negative sign bit and negative infinity. [Read more](trait.simdfloat#tymethod.is_sign_negative) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_nan(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_infinite(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is positive infinity or negative infinity. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_finite(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is neither infinite nor `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_subnormal(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is subnormal. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_normal(self) -> <Simd<f32, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is neither zero, infinite, subnormal, nor `NaN`. [Read more](trait.simdfloat#tymethod.is_normal) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn signum(self) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Replaces each lane with a number that represents its sign. [Read more](trait.simdfloat#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn copysign(self, sign: Simd<f32, LANES>) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns each lane with the magnitude of `self` and the sign of `sign`. [Read more](trait.simdfloat#tymethod.copysign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn simd\_min(self, other: Simd<f32, LANES>) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum of each lane. [Read more](trait.simdfloat#tymethod.simd_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn simd\_max(self, other: Simd<f32, LANES>) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum of each lane. [Read more](trait.simdfloat#tymethod.simd_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn simd\_clamp( self, min: Simd<f32, LANES>, max: Simd<f32, LANES>) -> Simd<f32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval unless it is NaN. [Read more](trait.simdfloat#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_sum(self) -> <Simd<f32, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector. [Read more](trait.simdfloat#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_product(self) -> <Simd<f32, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reducing multiply. Returns the product of the lanes of the vector. [Read more](trait.simdfloat#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_max(self) -> <Simd<f32, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdfloat#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_min(self) -> <Simd<f32, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdfloat#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)### impl<const LANES: usize> SimdFloat for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i64 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = f64 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. #### type Bits = Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Bit representation of this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn to\_bits(self) -> Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Raw transmutation to an unsigned integer vector type with the same size and number of lanes. [Read more](trait.simdfloat#tymethod.to_bits) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn from\_bits(bits: Simd<u64, LANES>) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Raw transmutation from an unsigned integer vector type with the same size and number of lanes. [Read more](trait.simdfloat#tymethod.from_bits) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn abs(self) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Produces a vector where every lane has the absolute value of the equivalently-indexed lane in `self`. [Read more](trait.simdfloat#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn recip(self) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Takes the reciprocal (inverse) of each lane, `1/x`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn to\_degrees(self) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts each lane from radians to degrees. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn to\_radians(self) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts each lane from degrees to radians. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_sign\_positive(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if it has a positive sign, including `+0.0`, `NaN`s with positive sign bit and positive infinity. [Read more](trait.simdfloat#tymethod.is_sign_positive) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_sign\_negative(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if it has a negative sign, including `-0.0`, `NaN`s with negative sign bit and negative infinity. [Read more](trait.simdfloat#tymethod.is_sign_negative) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_nan(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_infinite(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is positive infinity or negative infinity. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_finite(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is neither infinite nor `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_subnormal(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is subnormal. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn is\_normal(self) -> <Simd<f64, LANES> as SimdFloat>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is neither zero, infinite, subnormal, nor `NaN`. [Read more](trait.simdfloat#tymethod.is_normal) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn signum(self) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Replaces each lane with a number that represents its sign. [Read more](trait.simdfloat#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn copysign(self, sign: Simd<f64, LANES>) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns each lane with the magnitude of `self` and the sign of `sign`. [Read more](trait.simdfloat#tymethod.copysign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn simd\_min(self, other: Simd<f64, LANES>) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum of each lane. [Read more](trait.simdfloat#tymethod.simd_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn simd\_max(self, other: Simd<f64, LANES>) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum of each lane. [Read more](trait.simdfloat#tymethod.simd_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn simd\_clamp( self, min: Simd<f64, LANES>, max: Simd<f64, LANES>) -> Simd<f64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval unless it is NaN. [Read more](trait.simdfloat#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_sum(self) -> <Simd<f64, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector. [Read more](trait.simdfloat#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_product(self) -> <Simd<f64, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reducing multiply. Returns the product of the lanes of the vector. [Read more](trait.simdfloat#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_max(self) -> <Simd<f64, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdfloat#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)#### fn reduce\_min(self) -> <Simd<f64, LANES> as SimdFloat>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdfloat#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i16 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = i16 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_add(self, second: Simd<i16, LANES>) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simdint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_sub(self, second: Simd<i16, LANES>) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simdint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn abs(self) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value. [Read more](trait.simdint#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_abs(self) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_neg(self) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_positive(self) -> <Simd<i16, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each positive lane and false if it is zero or negative. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_negative(self) -> <Simd<i16, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each negative lane and false if it is zero or positive. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn signum(self) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns numbers representing the sign of each lane. [Read more](trait.simdint#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_sum(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [Read more](trait.simdint#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_product(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [Read more](trait.simdint#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_max(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdint#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_min(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdint#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_and(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_or(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_xor(self) -> <Simd<i16, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i32 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = i32 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_add(self, second: Simd<i32, LANES>) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simdint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_sub(self, second: Simd<i32, LANES>) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simdint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn abs(self) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value. [Read more](trait.simdint#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_abs(self) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_neg(self) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_positive(self) -> <Simd<i32, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each positive lane and false if it is zero or negative. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_negative(self) -> <Simd<i32, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each negative lane and false if it is zero or positive. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn signum(self) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns numbers representing the sign of each lane. [Read more](trait.simdint#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_sum(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [Read more](trait.simdint#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_product(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [Read more](trait.simdint#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_max(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdint#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_min(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdint#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_and(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_or(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_xor(self) -> <Simd<i32, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i64 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = i64 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_add(self, second: Simd<i64, LANES>) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simdint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_sub(self, second: Simd<i64, LANES>) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simdint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn abs(self) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value. [Read more](trait.simdint#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_abs(self) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_neg(self) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_positive(self) -> <Simd<i64, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each positive lane and false if it is zero or negative. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_negative(self) -> <Simd<i64, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each negative lane and false if it is zero or positive. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn signum(self) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns numbers representing the sign of each lane. [Read more](trait.simdint#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_sum(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [Read more](trait.simdint#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_product(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [Read more](trait.simdint#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_max(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdint#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_min(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdint#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_and(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_or(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_xor(self) -> <Simd<i64, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i8 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = i8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_add(self, second: Simd<i8, LANES>) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simdint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_sub(self, second: Simd<i8, LANES>) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simdint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn abs(self) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value. [Read more](trait.simdint#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_abs(self) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_neg(self) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_positive(self) -> <Simd<i8, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each positive lane and false if it is zero or negative. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_negative(self) -> <Simd<i8, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each negative lane and false if it is zero or positive. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn signum(self) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns numbers representing the sign of each lane. [Read more](trait.simdint#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_sum(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [Read more](trait.simdint#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_product(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [Read more](trait.simdint#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_max(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdint#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_min(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdint#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_and(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_or(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_xor(self) -> <Simd<i8, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)### impl<const LANES: usize> SimdInt for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<isize as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. #### type Scalar = isize 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_add(self, second: Simd<isize, LANES>) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simdint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_sub(self, second: Simd<isize, LANES>) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simdint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn abs(self) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value. [Read more](trait.simdint#tymethod.abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_abs(self) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_abs) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn saturating\_neg(self) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself. [Read more](trait.simdint#tymethod.saturating_neg) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_positive(self) -> <Simd<isize, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each positive lane and false if it is zero or negative. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn is\_negative(self) -> <Simd<isize, LANES> as SimdInt>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each negative lane and false if it is zero or positive. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn signum(self) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns numbers representing the sign of each lane. [Read more](trait.simdint#tymethod.signum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_sum(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [Read more](trait.simdint#tymethod.reduce_sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_product(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [Read more](trait.simdint#tymethod.reduce_product) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_max(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [Read more](trait.simdint#tymethod.reduce_max) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_min(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [Read more](trait.simdint#tymethod.reduce_min) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_and(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_or(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/int.rs.html#298)#### fn reduce\_xor(self) -> <Simd<isize, LANES> as SimdInt>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<i16, LANES>) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<i16, LANES>) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<i16, LANES>, max: Simd<i16, LANES>) -> Simd<i16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<i32, LANES>) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<i32, LANES>) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<i32, LANES>, max: Simd<i32, LANES>) -> Simd<i32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<i64, LANES>) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<i64, LANES>) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<i64, LANES>, max: Simd<i64, LANES>) -> Simd<i64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<i8, LANES>) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<i8, LANES>) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp(self, min: Simd<i8, LANES>, max: Simd<i8, LANES>) -> Simd<i8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<isize, LANES>) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<isize, LANES>) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<isize, LANES>, max: Simd<isize, LANES>) -> Simd<isize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<u16, LANES>) -> Simd<u16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<u16, LANES>) -> Simd<u16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<u16, LANES>, max: Simd<u16, LANES>) -> Simd<u16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<u32, LANES>) -> Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<u32, LANES>) -> Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<u32, LANES>, max: Simd<u32, LANES>) -> Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<u64, LANES>) -> Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<u64, LANES>) -> Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<u64, LANES>, max: Simd<u64, LANES>) -> Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<u8, LANES>) -> Simd<u8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<u8, LANES>) -> Simd<u8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp(self, min: Simd<u8, LANES>, max: Simd<u8, LANES>) -> Simd<u8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdOrd for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_max(self, other: Simd<usize, LANES>) -> Simd<usize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise maximum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_min(self, other: Simd<usize, LANES>) -> Simd<usize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the lane-wise minimum with `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_clamp( self, min: Simd<usize, LANES>, max: Simd<usize, LANES>) -> Simd<usize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval. [Read more](trait.simdord#tymethod.simd_clamp) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<f32 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<f32, LANES>) -> <Simd<f32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<f32, LANES>) -> <Simd<f32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<f64 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<f64, LANES>) -> <Simd<f64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<f64, LANES>) -> <Simd<f64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i16 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<i16, LANES>) -> <Simd<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<i16, LANES>) -> <Simd<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i32 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<i32, LANES>) -> <Simd<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<i32, LANES>) -> <Simd<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i64 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<i64, LANES>) -> <Simd<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<i64, LANES>) -> <Simd<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i8 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<i8, LANES>) -> <Simd<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<i8, LANES>) -> <Simd<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<isize as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<isize, LANES>) -> <Simd<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<isize, LANES>) -> <Simd<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u16 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<u16, LANES>) -> <Simd<u16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<u16, LANES>) -> <Simd<u16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u32 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<u32, LANES>) -> <Simd<u32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<u32, LANES>) -> <Simd<u32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u64 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<u64, LANES>) -> <Simd<u64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<u64, LANES>) -> <Simd<u64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u8 as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<u8, LANES>) -> <Simd<u8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<u8, LANES>) -> <Simd<u8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<usize as SimdElement>::Mask, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_eq( self, other: Simd<usize, LANES>) -> <Simd<usize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)#### fn simd\_ne( self, other: Simd<usize, LANES>) -> <Simd<usize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)### impl<const LANES: usize> SimdPartialOrd for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_lt( self, other: Simd<f32, LANES>) -> <Simd<f32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_le( self, other: Simd<f32, LANES>) -> <Simd<f32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_gt( self, other: Simd<f32, LANES>) -> <Simd<f32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_ge( self, other: Simd<f32, LANES>) -> <Simd<f32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)### impl<const LANES: usize> SimdPartialOrd for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_lt( self, other: Simd<f64, LANES>) -> <Simd<f64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_le( self, other: Simd<f64, LANES>) -> <Simd<f64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_gt( self, other: Simd<f64, LANES>) -> <Simd<f64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)#### fn simd\_ge( self, other: Simd<f64, LANES>) -> <Simd<f64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<i16, LANES>) -> <Simd<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<i16, LANES>) -> <Simd<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<i16, LANES>) -> <Simd<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<i16, LANES>) -> <Simd<i16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<i32, LANES>) -> <Simd<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<i32, LANES>) -> <Simd<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<i32, LANES>) -> <Simd<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<i32, LANES>) -> <Simd<i32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<i64, LANES>) -> <Simd<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<i64, LANES>) -> <Simd<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<i64, LANES>) -> <Simd<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<i64, LANES>) -> <Simd<i64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<i8, LANES>) -> <Simd<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<i8, LANES>) -> <Simd<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<i8, LANES>) -> <Simd<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<i8, LANES>) -> <Simd<i8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<isize, LANES>) -> <Simd<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<isize, LANES>) -> <Simd<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<isize, LANES>) -> <Simd<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<isize, LANES>) -> <Simd<isize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<u16, LANES>) -> <Simd<u16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<u16, LANES>) -> <Simd<u16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<u16, LANES>) -> <Simd<u16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<u16, LANES>) -> <Simd<u16, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<u32, LANES>) -> <Simd<u32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<u32, LANES>) -> <Simd<u32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<u32, LANES>) -> <Simd<u32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<u32, LANES>) -> <Simd<u32, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<u64, LANES>) -> <Simd<u64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<u64, LANES>) -> <Simd<u64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<u64, LANES>) -> <Simd<u64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<u64, LANES>) -> <Simd<u64, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<u8, LANES>) -> <Simd<u8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<u8, LANES>) -> <Simd<u8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<u8, LANES>) -> <Simd<u8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<u8, LANES>) -> <Simd<u8, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_lt( self, other: Simd<usize, LANES>) -> <Simd<usize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_le( self, other: Simd<usize, LANES>) -> <Simd<usize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_gt( self, other: Simd<usize, LANES>) -> <Simd<usize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)#### fn simd\_ge( self, other: Simd<usize, LANES>) -> <Simd<usize, LANES> as SimdPartialEq>::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u16 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_add(self, second: Simd<u16, LANES>) -> Simd<u16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simduint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_sub(self, second: Simd<u16, LANES>) -> Simd<u16, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simduint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_sum(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_product(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_max(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_min(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_and(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_or(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_xor(self) -> <Simd<u16, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u32 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_add(self, second: Simd<u32, LANES>) -> Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simduint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_sub(self, second: Simd<u32, LANES>) -> Simd<u32, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simduint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_sum(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_product(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_max(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_min(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_and(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_or(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_xor(self) -> <Simd<u32, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u64 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_add(self, second: Simd<u64, LANES>) -> Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simduint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_sub(self, second: Simd<u64, LANES>) -> Simd<u64, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simduint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_sum(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_product(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_max(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_min(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_and(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_or(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_xor(self) -> <Simd<u64, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = u8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_add(self, second: Simd<u8, LANES>) -> Simd<u8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simduint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_sub(self, second: Simd<u8, LANES>) -> Simd<u8, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simduint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_sum(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_product(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_max(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_min(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_and(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_or(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_xor(self) -> <Simd<u8, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)### impl<const LANES: usize> SimdUint for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Scalar = usize 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_add(self, second: Simd<usize, LANES>) -> Simd<usize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating add. [Read more](trait.simduint#tymethod.saturating_add) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn saturating\_sub(self, second: Simd<usize, LANES>) -> Simd<usize, LANES> 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Lanewise saturating subtract. [Read more](trait.simduint#tymethod.saturating_sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_sum(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector, with wrapping addition. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_product(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the product of the lanes of the vector, with wrapping multiplication. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_max(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_min(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_and(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “and” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_or(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “or” across the lanes of the vector. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/uint.rs.html#139)#### fn reduce\_xor(self) -> <Simd<usize, LANES> as SimdUint>::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the cumulative bitwise “xor” across the lanes of the vector. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#120-130)### impl<const N: usize> StdFloat for Simd<f32, N>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#127-129)#### fn fract(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the floating point’s fractional value, with its integer part removed. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#71-73)#### fn mul\_add(self, a: Self, b: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Fused multiply-add. Computes `(self * a) + b` with only one rounding error, yielding a more accurate result than an unfused multiply-add. [Read more](trait.stdfloat#method.mul_add) [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#79-81)#### fn sqrt(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Produces a vector where every lane has the square root value of the equivalently-indexed lane in `self` [Read more](trait.stdfloat#method.sqrt) [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#86-88)#### fn ceil(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the smallest integer greater than or equal to each lane. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#93-95)#### fn floor(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the largest integer value less than or equal to each lane. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#100-102)#### fn round(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Rounds to the nearest integer value. Ties round toward zero. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#107-109)#### fn trunc(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the floating point’s integer value, with its fractional part removed. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#132-142)### impl<const N: usize> StdFloat for Simd<f64, N>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#139-141)#### fn fract(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the floating point’s fractional value, with its integer part removed. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#71-73)#### fn mul\_add(self, a: Self, b: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Fused multiply-add. Computes `(self * a) + b` with only one rounding error, yielding a more accurate result than an unfused multiply-add. [Read more](trait.stdfloat#method.mul_add) [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#79-81)#### fn sqrt(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Produces a vector where every lane has the square root value of the equivalently-indexed lane in `self` [Read more](trait.stdfloat#method.sqrt) [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#86-88)#### fn ceil(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the smallest integer greater than or equal to each lane. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#93-95)#### fn floor(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the largest integer value less than or equal to each lane. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#100-102)#### fn round(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Rounds to the nearest integer value. Ties round toward zero. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#107-109)#### fn trunc(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the floating point’s integer value, with its fractional part removed. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Sub<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](../ops/trait.sub "trait std::ops::Sub")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](../ops/trait.sub "trait std::ops::Sub")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn sub( self, rhs: &Simd<T, LANES>) -> <&'lhs Simd<T, LANES> as Sub<&'rhs Simd<T, LANES>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Sub<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](../ops/trait.sub "trait std::ops::Sub")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](../ops/trait.sub "trait std::ops::Sub")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn sub( self, rhs: &Simd<T, LANES>) -> <Simd<T, LANES> as Sub<&Simd<T, LANES>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Sub<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](../ops/trait.sub "trait std::ops::Sub")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](../ops/trait.sub "trait std::ops::Sub")<[Simd](struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](../ops/trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)#### fn sub( self, rhs: Simd<T, LANES>) -> <&Simd<T, LANES> as Sub<Simd<T, LANES>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Sub<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn sub(self, rhs: Simd<f32, N>) -> <Simd<f32, N> as Sub<Simd<f32, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Sub<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)#### fn sub(self, rhs: Simd<f64, N>) -> <Simd<f64, N> as Sub<Simd<f64, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<i16, N>) -> <Simd<i16, N> as Sub<Simd<i16, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<i32, N>) -> <Simd<i32, N> as Sub<Simd<i32, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<i64, N>) -> <Simd<i64, N> as Sub<Simd<i64, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<i8, N>) -> <Simd<i8, N> as Sub<Simd<i8, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub( self, rhs: Simd<isize, N>) -> <Simd<isize, N> as Sub<Simd<isize, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<u16, N>) -> <Simd<u16, N> as Sub<Simd<u16, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<u32, N>) -> <Simd<u32, N> as Sub<Simd<u32, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<u64, N>) -> <Simd<u64, N> as Sub<Simd<u64, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub(self, rhs: Simd<u8, N>) -> <Simd<u8, N> as Sub<Simd<u8, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)#### fn sub( self, rhs: Simd<usize, N>) -> <Simd<usize, N> as Sub<Simd<usize, N>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> SubAssign<U> for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [Simd](struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](../ops/trait.sub "trait std::ops::Sub")<U>, [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](../ops/trait.sub "trait std::ops::Sub")<U>>::[Output](../ops/trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)#### fn sub\_assign(&mut self, rhs: U) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)### impl<'a, const LANES: usize> Sum<&'a Simd<f32, LANES>> for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)#### fn sum<I>(iter: I) -> Simd<f32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[f32](../primitive.f32), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)### impl<'a, const LANES: usize> Sum<&'a Simd<f64, LANES>> for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)#### fn sum<I>(iter: I) -> Simd<f64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[f64](../primitive.f64), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)### impl<'a, const LANES: usize> Sum<&'a Simd<i16, LANES>> for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)#### fn sum<I>(iter: I) -> Simd<i16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i16](../primitive.i16), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)### impl<'a, const LANES: usize> Sum<&'a Simd<i32, LANES>> for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)#### fn sum<I>(iter: I) -> Simd<i32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i32](../primitive.i32), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)### impl<'a, const LANES: usize> Sum<&'a Simd<i64, LANES>> for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)#### fn sum<I>(iter: I) -> Simd<i64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i64](../primitive.i64), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)### impl<'a, const LANES: usize> Sum<&'a Simd<i8, LANES>> for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)#### fn sum<I>(iter: I) -> Simd<i8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[i8](../primitive.i8), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)### impl<'a, const LANES: usize> Sum<&'a Simd<isize, LANES>> for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)#### fn sum<I>(iter: I) -> Simd<isize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[isize](../primitive.isize), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)### impl<'a, const LANES: usize> Sum<&'a Simd<u16, LANES>> for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)#### fn sum<I>(iter: I) -> Simd<u16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u16](../primitive.u16), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)### impl<'a, const LANES: usize> Sum<&'a Simd<u32, LANES>> for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)#### fn sum<I>(iter: I) -> Simd<u32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u32](../primitive.u32), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)### impl<'a, const LANES: usize> Sum<&'a Simd<u64, LANES>> for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)#### fn sum<I>(iter: I) -> Simd<u64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u64](../primitive.u64), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)### impl<'a, const LANES: usize> Sum<&'a Simd<u8, LANES>> for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)#### fn sum<I>(iter: I) -> Simd<u8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[u8](../primitive.u8), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)### impl<'a, const LANES: usize> Sum<&'a Simd<usize, LANES>> for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)#### fn sum<I>(iter: I) -> Simd<usize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Simd](struct.simd "struct std::simd::Simd")<[usize](../primitive.usize), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)### impl<const LANES: usize> Sum<Simd<f32, LANES>> for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#47)#### fn sum<I>(iter: I) -> Simd<f32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[f32](../primitive.f32), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)### impl<const LANES: usize> Sum<Simd<f64, LANES>> for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#48)#### fn sum<I>(iter: I) -> Simd<f64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[f64](../primitive.f64), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)### impl<const LANES: usize> Sum<Simd<i16, LANES>> for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#55)#### fn sum<I>(iter: I) -> Simd<i16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i16](../primitive.i16), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)### impl<const LANES: usize> Sum<Simd<i32, LANES>> for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#56)#### fn sum<I>(iter: I) -> Simd<i32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i32](../primitive.i32), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)### impl<const LANES: usize> Sum<Simd<i64, LANES>> for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#57)#### fn sum<I>(iter: I) -> Simd<i64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i64](../primitive.i64), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)### impl<const LANES: usize> Sum<Simd<i8, LANES>> for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#54)#### fn sum<I>(iter: I) -> Simd<i8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[i8](../primitive.i8), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)### impl<const LANES: usize> Sum<Simd<isize, LANES>> for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#58)#### fn sum<I>(iter: I) -> Simd<isize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[isize](../primitive.isize), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)### impl<const LANES: usize> Sum<Simd<u16, LANES>> for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#50)#### fn sum<I>(iter: I) -> Simd<u16, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u16](../primitive.u16), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)### impl<const LANES: usize> Sum<Simd<u32, LANES>> for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#51)#### fn sum<I>(iter: I) -> Simd<u32, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u32](../primitive.u32), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)### impl<const LANES: usize> Sum<Simd<u64, LANES>> for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#52)#### fn sum<I>(iter: I) -> Simd<u64, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u64](../primitive.u64), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)### impl<const LANES: usize> Sum<Simd<u8, LANES>> for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#49)#### fn sum<I>(iter: I) -> Simd<u8, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[u8](../primitive.u8), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)### impl<const LANES: usize> Sum<Simd<usize, LANES>> for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/iter.rs.html#53)#### fn sum<I>(iter: I) -> Simd<usize, LANES>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Simd](struct.simd "struct std::simd::Simd")<[usize](../primitive.usize), LANES>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> UpperExp for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [UpperExp](../fmt/trait.upperexp "trait std::fmt::UpperExp"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)### impl<T, const LANES: usize> UpperHex for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [UpperHex](../fmt/trait.upperhex "trait std::fmt::UpperHex"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/fmt.rs.html#31-39)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#471)### impl<T, const LANES: usize> Copy for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#542)### impl<T, const LANES: usize> Eq for Simd<T, LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement") + [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), Auto Trait Implementations -------------------------- ### impl<T, const LANES: usize> RefUnwindSafe for Simd<T, LANES>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, const LANES: usize> Send for Simd<T, LANES>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T, const LANES: usize> Sync for Simd<T, LANES>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T, const LANES: usize> Unpin for Simd<T, LANES>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T, const LANES: usize> UnwindSafe for Simd<T, LANES>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Trait std::simd::StdFloat Trait std::simd::StdFloat ========================= ``` pub trait StdFloat: Sealed + Sized { fn fract(self) -> Self; fn mul_add(self, a: Self, b: Self) -> Self { ... } fn sqrt(self) -> Self { ... } fn ceil(self) -> Self { ... } fn floor(self) -> Self { ... } fn round(self) -> Self { ... } fn trunc(self) -> Self { ... } } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) This trait provides a possibly-temporary implementation of float functions that may, in the absence of hardware support, canonicalize to calling an operating system’s `math.h` dynamically-loaded library (also known as a shared object). As these conditionally require runtime support, they should only appear in binaries built assuming OS support: `std`. However, there is no reason SIMD types, in general, need OS support, as for many architectures an embedded binary may simply configure that support itself. This means these types must be visible in `core` but have these functions available in `std`. [`f32`](../primitive.f32 "f32") and [`f64`](../primitive.f64 "f64") achieve a similar trick by using “lang items”, but due to compiler limitations, it is harder to implement this approach for abstract data types like [`Simd`](struct.simd "Simd"). From that need, this trait is born. It is possible this trait will be replaced in some manner in the future, when either the compiler or its supporting runtime functions are improved. For now this trait is available to permit experimentation with SIMD float operations that may lack hardware support, such as `mul_add`. Required Methods ---------------- [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#113)#### fn fract(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the floating point’s fractional value, with its integer part removed. Provided Methods ---------------- [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#71-73)#### fn mul\_add(self, a: Self, b: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Fused multiply-add. Computes `(self * a) + b` with only one rounding error, yielding a more accurate result than an unfused multiply-add. Using `mul_add` *may* be more performant than an unfused multiply-add if the target architecture has a dedicated `fma` CPU instruction. However, this is not always true, and will be heavily dependent on designing algorithms with specific target hardware in mind. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#79-81)#### fn sqrt(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Produces a vector where every lane has the square root value of the equivalently-indexed lane in `self` [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#86-88)#### fn ceil(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the smallest integer greater than or equal to each lane. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#93-95)#### fn floor(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the largest integer value less than or equal to each lane. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#100-102)#### fn round(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Rounds to the nearest integer value. Ties round toward zero. [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#107-109)#### fn trunc(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the floating point’s integer value, with its fractional part removed. Implementors ------------ [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#120-130)### impl<const N: usize> StdFloat for Simd<f32, N>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/std/up/up/portable-simd/crates/std_float/src/lib.rs.html#132-142)### impl<const N: usize> StdFloat for Simd<f64, N>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), rust Type Definition std::simd::usizex4 Type Definition std::simd::usizex4 ================================== ``` pub type usizex4 = Simd<usize, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector with four elements of type `usize`. rust Type Definition std::simd::u16x32 Type Definition std::simd::u16x32 ================================= ``` pub type u16x32 = Simd<u16, 32>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 32 elements of type `u16`. rust Type Definition std::simd::u16x2 Type Definition std::simd::u16x2 ================================ ``` pub type u16x2 = Simd<u16, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 32-bit SIMD vector with two elements of type `u16`. rust Type Definition std::simd::i16x16 Type Definition std::simd::i16x16 ================================= ``` pub type i16x16 = Simd<i16, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with 16 elements of type `i16`. rust Trait std::simd::Swizzle2 Trait std::simd::Swizzle2 ========================= ``` pub trait Swizzle2<const INPUT_LANES: usize, const OUTPUT_LANES: usize> { const INDEX: [Which; OUTPUT_LANES]; fn swizzle2<T>(        first: Simd<T, INPUT_LANES>,        second: Simd<T, INPUT_LANES>    ) -> Simd<T, OUTPUT_LANES>    where        T: SimdElement,        LaneCount<INPUT_LANES>: SupportedLaneCount,        LaneCount<OUTPUT_LANES>: SupportedLaneCount, { ... } } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Create a vector from the elements of two other vectors. Required Associated Constants ----------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#108)#### const INDEX: [Which; OUTPUT\_LANES] 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Map from the lanes of the input vectors to the output vector Provided Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#116-123)#### fn swizzle2<T>( first: Simd<T, INPUT\_LANES>, second: Simd<T, INPUT\_LANES>) -> Simd<T, OUTPUT\_LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<INPUT\_LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<OUTPUT\_LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Create a new vector from the lanes of `first` and `second`. Lane `i` is `first[j]` when `Self::INDEX[i]` is `First(j)`, or `second[j]` when it is `Second(j)`. Implementors ------------ rust Type Definition std::simd::f32x8 Type Definition std::simd::f32x8 ================================ ``` pub type f32x8 = Simd<f32, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with eight elements of type `f32`. rust Type Definition std::simd::u32x2 Type Definition std::simd::u32x2 ================================ ``` pub type u32x2 = Simd<u32, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with two elements of type `u32`. rust Type Definition std::simd::mask8x8 Type Definition std::simd::mask8x8 ================================== ``` pub type mask8x8 = Mask<i8, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with eight elements of 8 bits. rust Macro std::simd::simd_swizzle Macro std::simd::simd\_swizzle ============================== ``` pub macro simd_swizzle { ($vector:expr, $index:expr $(,)?) => { ... }, ($first:expr, $second:expr, $index:expr $(,)?) => { ... }, } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Constructs a new SIMD vector by copying elements from selected lanes in other vectors. When swizzling one vector, lanes are selected by a `const` array of `usize`, like [`Swizzle`](trait.swizzle "Swizzle"). When swizzling two vectors, lanes are selected by a `const` array of [`Which`](enum.which "Which"), like [`Swizzle2`](trait.swizzle2 "Swizzle2"). Examples -------- With a single SIMD vector, the const array specifies lane indices in that vector: ``` let v = u32x4::from_array([10, 11, 12, 13]); // Keeping the same size let r: u32x4 = simd_swizzle!(v, [3, 0, 1, 2]); assert_eq!(r.to_array(), [13, 10, 11, 12]); // Changing the number of lanes let r: u32x2 = simd_swizzle!(v, [3, 1]); assert_eq!(r.to_array(), [13, 11]); ``` With two input SIMD vectors, the const array uses `Which` to specify the source of each index: ``` use Which::{First, Second}; let a = u32x4::from_array([0, 1, 2, 3]); let b = u32x4::from_array([4, 5, 6, 7]); // Keeping the same size let r: u32x4 = simd_swizzle!(a, b, [First(0), First(1), Second(2), Second(3)]); assert_eq!(r.to_array(), [0, 1, 6, 7]); // Changing the number of lanes let r: u32x2 = simd_swizzle!(a, b, [First(0), Second(0)]); assert_eq!(r.to_array(), [0, 4]); ``` rust Trait std::simd::SimdPartialEq Trait std::simd::SimdPartialEq ============================== ``` pub trait SimdPartialEq { type Mask; fn simd_eq(self, other: Self) -> Self::Mask; fn simd_ne(self, other: Self) -> Self::Mask; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Parallel `PartialEq`. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#6)#### type Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The mask type returned by each comparison. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#10)#### fn simd\_eq(self, other: Self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#14)#### fn simd\_ne(self, other: Self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is equal to the corresponding lane in `other`. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i8, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i16, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i32, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<i64, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#73)### impl<const LANES: usize> SimdPartialEq for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<isize, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<f32 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<f64 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i8 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i16 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i32 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i64 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<isize as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u8 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u16 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u32 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<u64 as SimdElement>::Mask, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/eq.rs.html#44)### impl<const LANES: usize> SimdPartialEq for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<usize as SimdElement>::Mask, LANES> rust Type Definition std::simd::f32x4 Type Definition std::simd::f32x4 ================================ ``` pub type f32x4 = Simd<f32, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with four elements of type `f32`. rust Type Definition std::simd::mask16x32 Type Definition std::simd::mask16x32 ==================================== ``` pub type mask16x32 = Mask<i16, 32>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with 32 elements of 16 bits. rust Type Definition std::simd::mask8x64 Type Definition std::simd::mask8x64 =================================== ``` pub type mask8x64 = Mask<i8, 64>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with 64 elements of 8 bits. rust Type Definition std::simd::i64x8 Type Definition std::simd::i64x8 ================================ ``` pub type i64x8 = Simd<i64, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with eight elements of type `i64`.
programming_docs
rust Type Definition std::simd::usizex2 Type Definition std::simd::usizex2 ================================== ``` pub type usizex2 = Simd<usize, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector with two elements of type `usize`. rust Type Definition std::simd::i8x64 Type Definition std::simd::i8x64 ================================ ``` pub type i8x64 = Simd<i8, 64>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 64 elements of type `i8`. rust Type Definition std::simd::mask64x8 Type Definition std::simd::mask64x8 =================================== ``` pub type mask64x8 = Mask<i64, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with eight elements of 64 bits. rust Trait std::simd::MaskElement Trait std::simd::MaskElement ============================ ``` pub unsafe trait MaskElement: SimdElement + Sealed { } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Marker trait for types that may be used as SIMD mask elements. Safety ------ Type must be a signed integer. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#76)### impl MaskElement for i8 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#77)### impl MaskElement for i16 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#78)### impl MaskElement for i32 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#79)### impl MaskElement for i64 [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#80)### impl MaskElement for isize rust Struct std::simd::LaneCount Struct std::simd::LaneCount =========================== ``` pub struct LaneCount<const LANES: usize>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Specifies the number of lanes in a SIMD vector as a type. Implementations --------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#9)### impl<const LANES: usize> LaneCount<LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#11)#### pub const BITMASK\_LEN: usize = (LANES + 7) / 8 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) The number of bytes in a bitmask with this many lanes. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#26)### impl SupportedLaneCount for LaneCount<1> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#38)### impl SupportedLaneCount for LaneCount<16> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#29)### impl SupportedLaneCount for LaneCount<2> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#41)### impl SupportedLaneCount for LaneCount<32> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#32)### impl SupportedLaneCount for LaneCount<4> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#44)### impl SupportedLaneCount for LaneCount<64> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/lane_count.rs.html#35)### impl SupportedLaneCount for LaneCount<8> Auto Trait Implementations -------------------------- ### impl<const LANES: usize> RefUnwindSafe for LaneCount<LANES> ### impl<const LANES: usize> Send for LaneCount<LANES> ### impl<const LANES: usize> Sync for LaneCount<LANES> ### impl<const LANES: usize> Unpin for LaneCount<LANES> ### impl<const LANES: usize> UnwindSafe for LaneCount<LANES> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Type Definition std::simd::isizex8 Type Definition std::simd::isizex8 ================================== ``` pub type isizex8 = Simd<isize, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector with eight elements of type `isize`. rust Trait std::simd::SimdPartialOrd Trait std::simd::SimdPartialOrd =============================== ``` pub trait SimdPartialOrd: SimdPartialEq { fn simd_lt(self, other: Self) -> Self::Mask; fn simd_le(self, other: Self) -> Self::Mask; fn simd_gt(self, other: Self) -> Self::Mask; fn simd_ge(self, other: Self) -> Self::Mask; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Parallel `PartialOrd`. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#7)#### fn simd\_lt(self, other: Self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#11)#### fn simd\_le(self, other: Self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is less than or equal to the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#15)#### fn simd\_gt(self, other: Self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than the corresponding lane in `other`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#19)#### fn simd\_ge(self, other: Self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Test if each lane is greater than or equal to the corresponding lane in `other`. Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#213)### impl<const LANES: usize> SimdPartialOrd for Mask<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)### impl<const LANES: usize> SimdPartialOrd for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#148)### impl<const LANES: usize> SimdPartialOrd for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<i64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<isize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u8, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u16, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<u64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ord.rs.html#107)### impl<const LANES: usize> SimdPartialOrd for Simd<usize, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), rust Type Definition std::simd::i64x4 Type Definition std::simd::i64x4 ================================ ``` pub type i64x4 = Simd<i64, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with four elements of type `i64`. rust Trait std::simd::SimdFloat Trait std::simd::SimdFloat ========================== ``` pub trait SimdFloat: Copy + Sealed { type Mask; type Scalar; type Bits; Show 22 methods fn to_bits(self) -> Self::Bits; fn from_bits(bits: Self::Bits) -> Self; fn abs(self) -> Self; fn recip(self) -> Self; fn to_degrees(self) -> Self; fn to_radians(self) -> Self; fn is_sign_positive(self) -> Self::Mask; fn is_sign_negative(self) -> Self::Mask; fn is_nan(self) -> Self::Mask; fn is_infinite(self) -> Self::Mask; fn is_finite(self) -> Self::Mask; fn is_subnormal(self) -> Self::Mask; fn is_normal(self) -> Self::Mask; fn signum(self) -> Self; fn copysign(self, sign: Self) -> Self; fn simd_min(self, other: Self) -> Self; fn simd_max(self, other: Self) -> Self; fn simd_clamp(self, min: Self, max: Self) -> Self; fn reduce_sum(self) -> Self::Scalar; fn reduce_product(self) -> Self::Scalar; fn reduce_max(self) -> Self::Scalar; fn reduce_min(self) -> Self::Scalar; } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Operations on SIMD vectors of floats. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#10)#### type Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Mask type used for manipulating this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#13)#### type Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Scalar type contained by this SIMD vector type. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#16)#### type Bits 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Bit representation of this SIMD vector type. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#21)#### fn to\_bits(self) -> Self::Bits 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Raw transmutation to an unsigned integer vector type with the same size and number of lanes. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#26)#### fn from\_bits(bits: Self::Bits) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Raw transmutation from an unsigned integer vector type with the same size and number of lanes. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#31)#### fn abs(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Produces a vector where every lane has the absolute value of the equivalently-indexed lane in `self`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#35)#### fn recip(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Takes the reciprocal (inverse) of each lane, `1/x`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#39)#### fn to\_degrees(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts each lane from radians to degrees. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#43)#### fn to\_radians(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Converts each lane from degrees to radians. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#48)#### fn is\_sign\_positive(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if it has a positive sign, including `+0.0`, `NaN`s with positive sign bit and positive infinity. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#53)#### fn is\_sign\_negative(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if it has a negative sign, including `-0.0`, `NaN`s with negative sign bit and negative infinity. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#57)#### fn is\_nan(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#61)#### fn is\_infinite(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is positive infinity or negative infinity. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#65)#### fn is\_finite(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is neither infinite nor `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#69)#### fn is\_subnormal(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is subnormal. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#74)#### fn is\_normal(self) -> Self::Mask 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns true for each lane if its value is neither zero, infinite, subnormal, nor `NaN`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#82)#### fn signum(self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Replaces each lane with a number that represents its sign. * `1.0` if the number is positive, `+0.0`, or `INFINITY` * `-1.0` if the number is negative, `-0.0`, or `NEG_INFINITY` * `NAN` if the number is `NAN` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#88)#### fn copysign(self, sign: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns each lane with the magnitude of `self` and the sign of `sign`. For any lane containing a `NAN`, a `NAN` with the sign of `sign` is returned. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#94)#### fn simd\_min(self, other: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum of each lane. If one of the values is `NAN`, then the other value is returned. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#100)#### fn simd\_max(self, other: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum of each lane. If one of the values is `NAN`, then the other value is returned. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#108)#### fn simd\_clamp(self, min: Self, max: Self) -> Self 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Restrict each lane to a certain interval unless it is NaN. For each lane in `self`, returns the corresponding lane in `max` if the lane is greater than `max`, and the corresponding lane in `min` if the lane is less than `min`. Otherwise returns the lane in `self`. [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#122)#### fn reduce\_sum(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the sum of the lanes of the vector. ##### Examples ``` let v = f32x2::from_array([1., 2.]); assert_eq!(v.reduce_sum(), 3.); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#136)#### fn reduce\_product(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Reducing multiply. Returns the product of the lanes of the vector. ##### Examples ``` let v = f32x2::from_array([3., 4.]); assert_eq!(v.reduce_product(), 12.); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#163)#### fn reduce\_max(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the maximum lane in the vector. Returns values based on equality, so a vector containing both `0.` and `-0.` may return either. This function will not return `NaN` unless all lanes are `NaN`. ##### Examples ``` let v = f32x2::from_array([1., 2.]); assert_eq!(v.reduce_max(), 2.); // NaN values are skipped... let v = f32x2::from_array([1., f32::NAN]); assert_eq!(v.reduce_max(), 1.); // ...unless all values are NaN let v = f32x2::from_array([f32::NAN, f32::NAN]); assert!(v.reduce_max().is_nan()); ``` [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#190)#### fn reduce\_min(self) -> Self::Scalar 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Returns the minimum lane in the vector. Returns values based on equality, so a vector containing both `0.` and `-0.` may return either. This function will not return `NaN` unless all lanes are `NaN`. ##### Examples ``` let v = f32x2::from_array([3., 7.]); assert_eq!(v.reduce_min(), 3.); // NaN values are skipped... let v = f32x2::from_array([1., f32::NAN]); assert_eq!(v.reduce_min(), 1.); // ...unless all values are NaN let v = f32x2::from_array([f32::NAN, f32::NAN]); assert!(v.reduce_min().is_nan()); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)### impl<const LANES: usize> SimdFloat for Simd<f32, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i32 as SimdElement>::Mask, LANES> #### type Scalar = f32 #### type Bits = Simd<u32, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/elements/float.rs.html#357)### impl<const LANES: usize> SimdFloat for Simd<f64, LANES>where [LaneCount](struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Mask = Mask<<i64 as SimdElement>::Mask, LANES> #### type Scalar = f64 #### type Bits = Simd<u64, LANES>
programming_docs
rust Type Definition std::simd::mask64x4 Type Definition std::simd::mask64x4 =================================== ``` pub type mask64x4 = Mask<i64, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with four elements of 64 bits. rust Trait std::simd::Swizzle Trait std::simd::Swizzle ======================== ``` pub trait Swizzle<const INPUT_LANES: usize, const OUTPUT_LANES: usize> { const INDEX: [usize; OUTPUT_LANES]; fn swizzle<T>(vector: Simd<T, INPUT_LANES>) -> Simd<T, OUTPUT_LANES>    where        T: SimdElement,        LaneCount<INPUT_LANES>: SupportedLaneCount,        LaneCount<OUTPUT_LANES>: SupportedLaneCount, { ... } } ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Create a vector from the elements of another vector. Required Associated Constants ----------------------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#87)#### const INDEX: [usize; OUTPUT\_LANES] 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Map from the lanes of the input vector to the output vector. Provided Methods ---------------- [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#94-98)#### fn swizzle<T>(vector: Simd<T, INPUT\_LANES>) -> Simd<T, OUTPUT\_LANES>where T: [SimdElement](trait.simdelement "trait std::simd::SimdElement"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<INPUT\_LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [LaneCount](struct.lanecount "struct std::simd::LaneCount")<OUTPUT\_LANES>: [SupportedLaneCount](trait.supportedlanecount "trait std::simd::SupportedLaneCount"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Create a new vector from the lanes of `vector`. Lane `i` of the output is `vector[Self::INDEX[i]]`. Implementors ------------ rust Type Definition std::simd::isizex4 Type Definition std::simd::isizex4 ================================== ``` pub type isizex4 = Simd<isize, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A SIMD vector with four elements of type `isize`. rust Type Definition std::simd::i32x16 Type Definition std::simd::i32x16 ================================= ``` pub type i32x16 = Simd<i32, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 512-bit SIMD vector with 16 elements of type `i32`. rust Type Definition std::simd::u16x8 Type Definition std::simd::u16x8 ================================ ``` pub type u16x8 = Simd<u16, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with eight elements of type `u16`. rust Type Definition std::simd::f32x2 Type Definition std::simd::f32x2 ================================ ``` pub type f32x2 = Simd<f32, 2>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with two elements of type `f32`. rust Type Definition std::simd::u32x8 Type Definition std::simd::u32x8 ================================ ``` pub type u32x8 = Simd<u32, 8>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with eight elements of type `u32`. rust Type Definition std::simd::u16x4 Type Definition std::simd::u16x4 ================================ ``` pub type u16x4 = Simd<u16, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 64-bit SIMD vector with four elements of type `u16`. rust Type Definition std::simd::i8x32 Type Definition std::simd::i8x32 ================================ ``` pub type i8x32 = Simd<i8, 32>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 256-bit SIMD vector with 32 elements of type `i8`. rust Type Definition std::simd::u32x4 Type Definition std::simd::u32x4 ================================ ``` pub type u32x4 = Simd<u32, 4>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with four elements of type `u32`. rust Type Definition std::simd::mask8x32 Type Definition std::simd::mask8x32 =================================== ``` pub type mask8x32 = Mask<i8, 32>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A mask for SIMD vectors with 32 elements of 8 bits. rust Type Definition std::simd::u8x16 Type Definition std::simd::u8x16 ================================ ``` pub type u8x16 = Simd<u8, 16>; ``` 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) A 128-bit SIMD vector with 16 elements of type `u8`. rust Struct std::num::NonZeroIsize Struct std::num::NonZeroIsize ============================= ``` #[repr(transparent)]pub struct NonZeroIsize(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroIsize>` is the same size as `isize`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroIsize>>(), size_of::<isize>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const unsafe fn new\_unchecked(n: isize) -> NonZeroIsize Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: isize) -> Option<NonZeroIsize> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> isize Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroIsize::new(-1isize).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroIsize::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)### impl NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn abs(self) -> NonZeroIsize Computes the absolute value of self. See [`isize::abs`](../primitive.isize#method.abs "isize::abs") for documentation on overflow behaviour. ##### Example ``` let pos = NonZeroIsize::new(1)?; let neg = NonZeroIsize::new(-1)?; assert_eq!(pos, pos.abs()); assert_eq!(pos, neg.abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn checked\_abs(self) -> Option<NonZeroIsize> Checked absolute value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if `self == isize::MIN`. The result cannot be zero. ##### Example ``` let pos = NonZeroIsize::new(1)?; let neg = NonZeroIsize::new(-1)?; let min = NonZeroIsize::new(isize::MIN)?; assert_eq!(Some(pos), neg.checked_abs()); assert_eq!(None, min.checked_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn overflowing\_abs(self) -> (NonZeroIsize, bool) Computes the absolute value of self, with overflow information, see [`isize::overflowing_abs`](../primitive.isize#method.overflowing_abs "isize::overflowing_abs"). ##### Example ``` let pos = NonZeroIsize::new(1)?; let neg = NonZeroIsize::new(-1)?; let min = NonZeroIsize::new(isize::MIN)?; assert_eq!((pos, false), pos.overflowing_abs()); assert_eq!((pos, false), neg.overflowing_abs()); assert_eq!((min, true), min.overflowing_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_abs(self) -> NonZeroIsize Saturating absolute value, see [`isize::saturating_abs`](../primitive.isize#method.saturating_abs "isize::saturating_abs"). ##### Example ``` let pos = NonZeroIsize::new(1)?; let neg = NonZeroIsize::new(-1)?; let min = NonZeroIsize::new(isize::MIN)?; let min_plus = NonZeroIsize::new(isize::MIN + 1)?; let max = NonZeroIsize::new(isize::MAX)?; assert_eq!(pos, pos.saturating_abs()); assert_eq!(pos, neg.saturating_abs()); assert_eq!(max, min.saturating_abs()); assert_eq!(max, min_plus.saturating_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn wrapping\_abs(self) -> NonZeroIsize Wrapping absolute value, see [`isize::wrapping_abs`](../primitive.isize#method.wrapping_abs "isize::wrapping_abs"). ##### Example ``` let pos = NonZeroIsize::new(1)?; let neg = NonZeroIsize::new(-1)?; let min = NonZeroIsize::new(isize::MIN)?; let max = NonZeroIsize::new(isize::MAX)?; assert_eq!(pos, pos.wrapping_abs()); assert_eq!(pos, neg.wrapping_abs()); assert_eq!(min, min.wrapping_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn unsigned\_abs(self) -> NonZeroUsize Computes the absolute value of self without any wrapping or panicking. ##### Example ``` let u_pos = NonZeroUsize::new(1)?; let i_pos = NonZeroIsize::new(1)?; let i_neg = NonZeroIsize::new(-1)?; let i_min = NonZeroIsize::new(isize::MIN)?; let u_max = NonZeroUsize::new(usize::MAX / 2 + 1)?; assert_eq!(u_pos, i_pos.unsigned_abs()); assert_eq!(u_pos, i_neg.unsigned_abs()); assert_eq!(u_max, i_min.unsigned_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroIsize) -> Option<NonZeroIsize> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroIsize::new(2)?; let four = NonZeroIsize::new(4)?; let max = NonZeroIsize::new(isize::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroIsize) -> NonZeroIsize Multiplies two non-zero integers together. Return [`isize::MAX`](../primitive.isize#associatedconstant.MAX "isize::MAX") on overflow. ##### Examples ``` let two = NonZeroIsize::new(2)?; let four = NonZeroIsize::new(4)?; let max = NonZeroIsize::new(isize::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroIsize) -> NonZeroIsize 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > isize::MAX`, or `self * rhs < isize::MIN`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroIsize::new(2)?; let four = NonZeroIsize::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroIsize> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroIsize::new(3)?; let twenty_seven = NonZeroIsize::new(27)?; let half_max = NonZeroIsize::new(isize::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroIsize Raise non-zero value to an integer power. Return [`isize::MIN`](../primitive.isize#associatedconstant.MIN "isize::MIN") or [`isize::MAX`](../primitive.isize#associatedconstant.MAX "isize::MAX") on overflow. ##### Examples ``` let three = NonZeroIsize::new(3)?; let twenty_seven = NonZeroIsize::new(27)?; let max = NonZeroIsize::new(isize::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)### impl NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MIN: NonZeroIsize = Self::new(isize::MIN).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, equal to [`isize::MIN`](../primitive.isize#associatedconstant.MIN "isize::MIN"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroIsize::MIN.get(), isize::MIN); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MAX: NonZeroIsize = Self::new(isize::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`isize::MAX`](../primitive.isize#associatedconstant.MAX "isize::MAX"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroIsize::MAX.get(), isize::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`isize::BITS`](../primitive.isize#associatedconstant.BITS "isize::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroIsize::BITS, isize::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroIsize> for NonZeroIsize #### type Output = NonZeroIsize The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, rhs: NonZeroIsize) -> <NonZeroIsize as BitOr<NonZeroIsize>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroIsize> for isize #### type Output = NonZeroIsize The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroIsize) -> <isize as BitOr<NonZeroIsize>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<isize> for NonZeroIsize #### type Output = NonZeroIsize The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: isize) -> <NonZeroIsize as BitOr<isize>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroIsize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroIsize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<isize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: isize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroIsize Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#441)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#441)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroIsize Converts `NonZeroI16` to `NonZeroIsize` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#437)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#437)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroIsize Converts `NonZeroI8` to `NonZeroIsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroIsize> for isize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroIsize) -> isize Converts a `NonZeroIsize` into an `isize` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#451)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#451)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroIsize Converts `NonZeroU8` to `NonZeroIsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroIsize #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroIsize, <NonZeroIsize as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroIsize) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroIsize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroIsize) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroIsize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroIsize) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#498)1.46.0 · ### impl TryFrom<isize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#498)#### fn try\_from( value: isize) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<isize>>::Error> Attempts to convert `isize` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroIsize Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroIsize ### impl Send for NonZeroIsize ### impl Sync for NonZeroIsize ### impl Unpin for NonZeroIsize ### impl UnwindSafe for NonZeroIsize Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroI32 Struct std::num::NonZeroI32 =========================== ``` #[repr(transparent)]pub struct NonZeroI32(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroI32>` is the same size as `i32`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroI32>>(), size_of::<i32>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const unsafe fn new\_unchecked(n: i32) -> NonZeroI32 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: i32) -> Option<NonZeroI32> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> i32 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI32::new(-1i32).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI32::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)### impl NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn abs(self) -> NonZeroI32 Computes the absolute value of self. See [`i32::abs`](../primitive.i32#method.abs "i32::abs") for documentation on overflow behaviour. ##### Example ``` let pos = NonZeroI32::new(1)?; let neg = NonZeroI32::new(-1)?; assert_eq!(pos, pos.abs()); assert_eq!(pos, neg.abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn checked\_abs(self) -> Option<NonZeroI32> Checked absolute value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if `self == i32::MIN`. The result cannot be zero. ##### Example ``` let pos = NonZeroI32::new(1)?; let neg = NonZeroI32::new(-1)?; let min = NonZeroI32::new(i32::MIN)?; assert_eq!(Some(pos), neg.checked_abs()); assert_eq!(None, min.checked_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn overflowing\_abs(self) -> (NonZeroI32, bool) Computes the absolute value of self, with overflow information, see [`i32::overflowing_abs`](../primitive.i32#method.overflowing_abs "i32::overflowing_abs"). ##### Example ``` let pos = NonZeroI32::new(1)?; let neg = NonZeroI32::new(-1)?; let min = NonZeroI32::new(i32::MIN)?; assert_eq!((pos, false), pos.overflowing_abs()); assert_eq!((pos, false), neg.overflowing_abs()); assert_eq!((min, true), min.overflowing_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_abs(self) -> NonZeroI32 Saturating absolute value, see [`i32::saturating_abs`](../primitive.i32#method.saturating_abs "i32::saturating_abs"). ##### Example ``` let pos = NonZeroI32::new(1)?; let neg = NonZeroI32::new(-1)?; let min = NonZeroI32::new(i32::MIN)?; let min_plus = NonZeroI32::new(i32::MIN + 1)?; let max = NonZeroI32::new(i32::MAX)?; assert_eq!(pos, pos.saturating_abs()); assert_eq!(pos, neg.saturating_abs()); assert_eq!(max, min.saturating_abs()); assert_eq!(max, min_plus.saturating_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn wrapping\_abs(self) -> NonZeroI32 Wrapping absolute value, see [`i32::wrapping_abs`](../primitive.i32#method.wrapping_abs "i32::wrapping_abs"). ##### Example ``` let pos = NonZeroI32::new(1)?; let neg = NonZeroI32::new(-1)?; let min = NonZeroI32::new(i32::MIN)?; let max = NonZeroI32::new(i32::MAX)?; assert_eq!(pos, pos.wrapping_abs()); assert_eq!(pos, neg.wrapping_abs()); assert_eq!(min, min.wrapping_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn unsigned\_abs(self) -> NonZeroU32 Computes the absolute value of self without any wrapping or panicking. ##### Example ``` let u_pos = NonZeroU32::new(1)?; let i_pos = NonZeroI32::new(1)?; let i_neg = NonZeroI32::new(-1)?; let i_min = NonZeroI32::new(i32::MIN)?; let u_max = NonZeroU32::new(u32::MAX / 2 + 1)?; assert_eq!(u_pos, i_pos.unsigned_abs()); assert_eq!(u_pos, i_neg.unsigned_abs()); assert_eq!(u_max, i_min.unsigned_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroI32) -> Option<NonZeroI32> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroI32::new(2)?; let four = NonZeroI32::new(4)?; let max = NonZeroI32::new(i32::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroI32) -> NonZeroI32 Multiplies two non-zero integers together. Return [`i32::MAX`](../primitive.i32#associatedconstant.MAX "i32::MAX") on overflow. ##### Examples ``` let two = NonZeroI32::new(2)?; let four = NonZeroI32::new(4)?; let max = NonZeroI32::new(i32::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroI32) -> NonZeroI32 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > i32::MAX`, or `self * rhs < i32::MIN`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroI32::new(2)?; let four = NonZeroI32::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroI32> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroI32::new(3)?; let twenty_seven = NonZeroI32::new(27)?; let half_max = NonZeroI32::new(i32::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroI32 Raise non-zero value to an integer power. Return [`i32::MIN`](../primitive.i32#associatedconstant.MIN "i32::MIN") or [`i32::MAX`](../primitive.i32#associatedconstant.MAX "i32::MAX") on overflow. ##### Examples ``` let three = NonZeroI32::new(3)?; let twenty_seven = NonZeroI32::new(27)?; let max = NonZeroI32::new(i32::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)### impl NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MIN: NonZeroI32 = Self::new(i32::MIN).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, equal to [`i32::MIN`](../primitive.i32#associatedconstant.MIN "i32::MIN"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI32::MIN.get(), i32::MIN); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MAX: NonZeroI32 = Self::new(i32::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`i32::MAX`](../primitive.i32#associatedconstant.MAX "i32::MAX"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI32::MAX.get(), i32::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 32u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`i32::BITS`](../primitive.i32#associatedconstant.BITS "i32::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroI32::BITS, i32::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI32> for NonZeroI32 #### type Output = NonZeroI32 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI32) -> <NonZeroI32 as BitOr<NonZeroI32>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI32> for i32 #### type Output = NonZeroI32 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI32) -> <i32 as BitOr<NonZeroI32>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i32> for NonZeroI32 #### type Output = NonZeroI32 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: i32) -> <NonZeroI32 as BitOr<i32>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroI32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: i32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroI32 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#438)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#438)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroI32 Converts `NonZeroI16` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#443)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI32> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#443)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI32) -> NonZeroI128 Converts `NonZeroI32` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#442)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI32> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#442)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI32) -> NonZeroI64 Converts `NonZeroI32` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI32> for i32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroI32) -> i32 Converts a `NonZeroI32` into an `i32` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#434)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#434)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI32 Converts `NonZeroI8` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#452)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#452)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroI32 Converts `NonZeroU16` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#448)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#448)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI32 Converts `NonZeroU8` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroI32 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroI32, <NonZeroI32 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroI32) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroI32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroI32) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroI32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroI32) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#495)1.46.0 · ### impl TryFrom<i32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#495)#### fn try\_from( value: i32) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<i32>>::Error> Attempts to convert `i32` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroI32 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroI32 ### impl Send for NonZeroI32 ### impl Sync for NonZeroI32 ### impl Unpin for NonZeroI32 ### impl UnwindSafe for NonZeroI32 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroU8 Struct std::num::NonZeroU8 ========================== ``` #[repr(transparent)]pub struct NonZeroU8(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroU8>` is the same size as `u8`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroU8>>(), size_of::<u8>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.28.0 · #### pub const unsafe fn new\_unchecked(n: u8) -> NonZeroU8 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: u8) -> Option<NonZeroU8> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> u8 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU8::new(u8::MAX).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU8::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_add(self, other: u8) -> Option<NonZeroU8> Adds an unsigned integer to a non-zero value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let one = NonZeroU8::new(1)?; let two = NonZeroU8::new(2)?; let max = NonZeroU8::new(u8::MAX)?; assert_eq!(Some(two), one.checked_add(1)); assert_eq!(None, max.checked_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_add(self, other: u8) -> NonZeroU8 Adds an unsigned integer to a non-zero value. Return [`u8::MAX`](../primitive.u8#associatedconstant.MAX "u8::MAX") on overflow. ##### Examples ``` let one = NonZeroU8::new(1)?; let two = NonZeroU8::new(2)?; let max = NonZeroU8::new(u8::MAX)?; assert_eq!(two, one.saturating_add(1)); assert_eq!(max, max.saturating_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const unsafe fn unchecked\_add(self, other: u8) -> NonZeroU8 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self + rhs > u8::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let one = NonZeroU8::new(1)?; let two = NonZeroU8::new(2)?; assert_eq!(two, unsafe { one.unchecked_add(1) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<NonZeroU8> Returns the smallest power of two greater than or equal to n. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if the next power of two is greater than the type’s maximum value. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU8::new(2)?; let three = NonZeroU8::new(3)?; let four = NonZeroU8::new(4)?; let max = NonZeroU8::new(u8::MAX)?; assert_eq!(Some(two), two.checked_next_power_of_two() ); assert_eq!(Some(four), three.checked_next_power_of_two() ); assert_eq!(None, max.checked_next_power_of_two() ); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog2(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 2 logarithm of the number, rounded down. This is the same operation as [`u8::ilog2`](../primitive.u8#method.ilog2 "u8::ilog2"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU8::new(7).unwrap().ilog2(), 2); assert_eq!(NonZeroU8::new(8).unwrap().ilog2(), 3); assert_eq!(NonZeroU8::new(9).unwrap().ilog2(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog10(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 10 logarithm of the number, rounded down. This is the same operation as [`u8::ilog10`](../primitive.u8#method.ilog10 "u8::ilog10"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU8::new(99).unwrap().ilog10(), 1); assert_eq!(NonZeroU8::new(100).unwrap().ilog10(), 2); assert_eq!(NonZeroU8::new(101).unwrap().ilog10(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroU8) -> Option<NonZeroU8> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU8::new(2)?; let four = NonZeroU8::new(4)?; let max = NonZeroU8::new(u8::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroU8) -> NonZeroU8 Multiplies two non-zero integers together. Return [`u8::MAX`](../primitive.u8#associatedconstant.MAX "u8::MAX") on overflow. ##### Examples ``` let two = NonZeroU8::new(2)?; let four = NonZeroU8::new(4)?; let max = NonZeroU8::new(u8::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroU8) -> NonZeroU8 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > u8::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroU8::new(2)?; let four = NonZeroU8::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroU8> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroU8::new(3)?; let twenty_seven = NonZeroU8::new(27)?; let half_max = NonZeroU8::new(u8::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroU8 Raise non-zero value to an integer power. Return [`u8::MAX`](../primitive.u8#associatedconstant.MAX "u8::MAX") on overflow. ##### Examples ``` let three = NonZeroU8::new(3)?; let twenty_seven = NonZeroU8::new(27)?; let max = NonZeroU8::new(u8::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)1.59.0 (const: 1.59.0) · #### pub const fn is\_power\_of\_two(self) -> bool Returns `true` if and only if `self == (1 << k)` for some `k`. On many architectures, this function can perform better than `is_power_of_two()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let eight = std::num::NonZeroU8::new(8).unwrap(); assert!(eight.is_power_of_two()); let ten = std::num::NonZeroU8::new(10).unwrap(); assert!(!ten.is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MIN: NonZeroU8 = Self::new(1).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, 1. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU8::MIN.get(), 1u8); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MAX: NonZeroU8 = Self::new(u8::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`u8::MAX`](../primitive.u8#associatedconstant.MAX "u8::MAX"). ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU8::MAX.get(), u8::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 8u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`u8::BITS`](../primitive.u8#associatedconstant.BITS "u8::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroU8::BITS, u8::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU8> for NonZeroU8 #### type Output = NonZeroU8 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU8) -> <NonZeroU8 as BitOr<NonZeroU8>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU8> for u8 #### type Output = NonZeroU8 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU8) -> <u8 as BitOr<NonZeroU8>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u8> for NonZeroU8 #### type Output = NonZeroU8 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: u8) -> <NonZeroU8 as BitOr<u8>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroU8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: u8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroU8 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU8> for u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: NonZeroU8) -> u8 This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic. #### type Output = u8 The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#450)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#450)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI128 Converts `NonZeroU8` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#447)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#447)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI16 Converts `NonZeroU8` to `NonZeroI16` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#448)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#448)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI32 Converts `NonZeroU8` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#449)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#449)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI64 Converts `NonZeroU8` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#451)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#451)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroIsize Converts `NonZeroU8` to `NonZeroIsize` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#422)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#422)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU128 Converts `NonZeroU8` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#419)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#419)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU16 Converts `NonZeroU8` to `NonZeroU16` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#420)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#420)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU32 Converts `NonZeroU8` to `NonZeroU32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#421)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#421)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU64 Converts `NonZeroU8` to `NonZeroU64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#423)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#423)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroUsize Converts `NonZeroU8` to `NonZeroUsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroU8) -> u8 Converts a `NonZeroU8` into an `u8` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroU8 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroU8, <NonZeroU8 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroU8) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroU8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroU8) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroU8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroU8) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU8> for u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: NonZeroU8) -> u8 This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #### type Output = u8 The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU8) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU8>>::Error> Attempts to convert `NonZeroU8` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#487)1.46.0 · ### impl TryFrom<u8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#487)#### fn try\_from(value: u8) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<u8>>::Error> Attempts to convert `u8` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroU8 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroU8 ### impl Send for NonZeroU8 ### impl Sync for NonZeroU8 ### impl Unpin for NonZeroU8 ### impl UnwindSafe for NonZeroU8 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroU128 Struct std::num::NonZeroU128 ============================ ``` #[repr(transparent)]pub struct NonZeroU128(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroU128>` is the same size as `u128`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroU128>>(), size_of::<u128>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.28.0 · #### pub const unsafe fn new\_unchecked(n: u128) -> NonZeroU128 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: u128) -> Option<NonZeroU128> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> u128 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU128::new(u128::MAX).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU128::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_add(self, other: u128) -> Option<NonZeroU128> Adds an unsigned integer to a non-zero value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let one = NonZeroU128::new(1)?; let two = NonZeroU128::new(2)?; let max = NonZeroU128::new(u128::MAX)?; assert_eq!(Some(two), one.checked_add(1)); assert_eq!(None, max.checked_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_add(self, other: u128) -> NonZeroU128 Adds an unsigned integer to a non-zero value. Return [`u128::MAX`](../primitive.u128#associatedconstant.MAX "u128::MAX") on overflow. ##### Examples ``` let one = NonZeroU128::new(1)?; let two = NonZeroU128::new(2)?; let max = NonZeroU128::new(u128::MAX)?; assert_eq!(two, one.saturating_add(1)); assert_eq!(max, max.saturating_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const unsafe fn unchecked\_add(self, other: u128) -> NonZeroU128 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self + rhs > u128::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let one = NonZeroU128::new(1)?; let two = NonZeroU128::new(2)?; assert_eq!(two, unsafe { one.unchecked_add(1) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<NonZeroU128> Returns the smallest power of two greater than or equal to n. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if the next power of two is greater than the type’s maximum value. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU128::new(2)?; let three = NonZeroU128::new(3)?; let four = NonZeroU128::new(4)?; let max = NonZeroU128::new(u128::MAX)?; assert_eq!(Some(two), two.checked_next_power_of_two() ); assert_eq!(Some(four), three.checked_next_power_of_two() ); assert_eq!(None, max.checked_next_power_of_two() ); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog2(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 2 logarithm of the number, rounded down. This is the same operation as [`u128::ilog2`](../primitive.u128#method.ilog2 "u128::ilog2"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU128::new(7).unwrap().ilog2(), 2); assert_eq!(NonZeroU128::new(8).unwrap().ilog2(), 3); assert_eq!(NonZeroU128::new(9).unwrap().ilog2(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog10(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 10 logarithm of the number, rounded down. This is the same operation as [`u128::ilog10`](../primitive.u128#method.ilog10 "u128::ilog10"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU128::new(99).unwrap().ilog10(), 1); assert_eq!(NonZeroU128::new(100).unwrap().ilog10(), 2); assert_eq!(NonZeroU128::new(101).unwrap().ilog10(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroU128) -> Option<NonZeroU128> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU128::new(2)?; let four = NonZeroU128::new(4)?; let max = NonZeroU128::new(u128::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroU128) -> NonZeroU128 Multiplies two non-zero integers together. Return [`u128::MAX`](../primitive.u128#associatedconstant.MAX "u128::MAX") on overflow. ##### Examples ``` let two = NonZeroU128::new(2)?; let four = NonZeroU128::new(4)?; let max = NonZeroU128::new(u128::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroU128) -> NonZeroU128 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > u128::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroU128::new(2)?; let four = NonZeroU128::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroU128> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroU128::new(3)?; let twenty_seven = NonZeroU128::new(27)?; let half_max = NonZeroU128::new(u128::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroU128 Raise non-zero value to an integer power. Return [`u128::MAX`](../primitive.u128#associatedconstant.MAX "u128::MAX") on overflow. ##### Examples ``` let three = NonZeroU128::new(3)?; let twenty_seven = NonZeroU128::new(27)?; let max = NonZeroU128::new(u128::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)1.59.0 (const: 1.59.0) · #### pub const fn is\_power\_of\_two(self) -> bool Returns `true` if and only if `self == (1 << k)` for some `k`. On many architectures, this function can perform better than `is_power_of_two()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let eight = std::num::NonZeroU128::new(8).unwrap(); assert!(eight.is_power_of_two()); let ten = std::num::NonZeroU128::new(10).unwrap(); assert!(!ten.is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MIN: NonZeroU128 = Self::new(1).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, 1. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU128::MIN.get(), 1u128); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MAX: NonZeroU128 = Self::new(u128::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`u128::MAX`](../primitive.u128#associatedconstant.MAX "u128::MAX"). ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU128::MAX.get(), u128::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 128u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`u128::BITS`](../primitive.u128#associatedconstant.BITS "u128::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroU128::BITS, u128::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU128> for NonZeroU128 #### type Output = NonZeroU128 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU128) -> <NonZeroU128 as BitOr<NonZeroU128>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU128> for u128 #### type Output = NonZeroU128 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU128) -> <u128 as BitOr<NonZeroU128>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u128> for NonZeroU128 #### type Output = NonZeroU128 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: u128) -> <NonZeroU128 as BitOr<u128>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroU128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: u128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroU128 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU128> for u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: NonZeroU128) -> u128 This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic. #### type Output = u128 The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU128> for u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroU128) -> u128 Converts a `NonZeroU128` into an `u128` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#426)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#426)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroU128 Converts `NonZeroU16` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#429)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#429)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroU128 Converts `NonZeroU32` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#430)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU64> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#430)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU64) -> NonZeroU128 Converts `NonZeroU64` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#422)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#422)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU128 Converts `NonZeroU8` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroU128 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroU128, <NonZeroU128 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroU128) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroU128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroU128) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroU128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroU128) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU128> for u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: NonZeroU128) -> u128 This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #### type Output = u128 The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#491)1.46.0 · ### impl TryFrom<u128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#491)#### fn try\_from( value: u128) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<u128>>::Error> Attempts to convert `u128` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroU128 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroU128 ### impl Send for NonZeroU128 ### impl Sync for NonZeroU128 ### impl Unpin for NonZeroU128 ### impl UnwindSafe for NonZeroU128 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Enum std::num::IntErrorKind Enum std::num::IntErrorKind =========================== ``` #[non_exhaustive] pub enum IntErrorKind { Empty, InvalidDigit, PosOverflow, NegOverflow, Zero, } ``` Enum to store the various types of errors that can cause parsing an integer to fail. Example ------- ``` if let Err(e) = i32::from_str_radix("a12", 10) { println!("Failed conversion to i32: {:?}", e.kind()); } ``` Variants (Non-exhaustive) ------------------------- This enum is marked as non-exhaustiveNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### `Empty` Value being parsed is empty. This variant will be constructed when parsing an empty string. ### `InvalidDigit` Contains an invalid digit in its context. Among other causes, this variant will be constructed when parsing a string that contains a non-ASCII char. This variant is also constructed when a `+` or `-` is misplaced within a string either on its own or in the middle of a number. ### `PosOverflow` Integer is too large to store in target integer type. ### `NegOverflow` Integer is too small to store in target integer type. ### `Zero` Value was Zero This variant will be emitted when the parsing string has a value of zero, which would be illegal for non-zero types. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)### impl Clone for IntErrorKind [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)#### fn clone(&self) -> IntErrorKind Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)### impl Debug for IntErrorKind [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)### impl PartialEq<IntErrorKind> for IntErrorKind [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)#### fn eq(&self, other: &IntErrorKind) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)### impl Eq for IntErrorKind [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)### impl StructuralEq for IntErrorKind [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)### impl StructuralPartialEq for IntErrorKind Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for IntErrorKind ### impl Send for IntErrorKind ### impl Sync for IntErrorKind ### impl Unpin for IntErrorKind ### impl UnwindSafe for IntErrorKind Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::num::NonZeroI128 Struct std::num::NonZeroI128 ============================ ``` #[repr(transparent)]pub struct NonZeroI128(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroI128>` is the same size as `i128`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroI128>>(), size_of::<i128>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const unsafe fn new\_unchecked(n: i128) -> NonZeroI128 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: i128) -> Option<NonZeroI128> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> i128 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI128::new(-1i128).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI128::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)### impl NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn abs(self) -> NonZeroI128 Computes the absolute value of self. See [`i128::abs`](../primitive.i128#method.abs "i128::abs") for documentation on overflow behaviour. ##### Example ``` let pos = NonZeroI128::new(1)?; let neg = NonZeroI128::new(-1)?; assert_eq!(pos, pos.abs()); assert_eq!(pos, neg.abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn checked\_abs(self) -> Option<NonZeroI128> Checked absolute value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if `self == i128::MIN`. The result cannot be zero. ##### Example ``` let pos = NonZeroI128::new(1)?; let neg = NonZeroI128::new(-1)?; let min = NonZeroI128::new(i128::MIN)?; assert_eq!(Some(pos), neg.checked_abs()); assert_eq!(None, min.checked_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn overflowing\_abs(self) -> (NonZeroI128, bool) Computes the absolute value of self, with overflow information, see [`i128::overflowing_abs`](../primitive.i128#method.overflowing_abs "i128::overflowing_abs"). ##### Example ``` let pos = NonZeroI128::new(1)?; let neg = NonZeroI128::new(-1)?; let min = NonZeroI128::new(i128::MIN)?; assert_eq!((pos, false), pos.overflowing_abs()); assert_eq!((pos, false), neg.overflowing_abs()); assert_eq!((min, true), min.overflowing_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_abs(self) -> NonZeroI128 Saturating absolute value, see [`i128::saturating_abs`](../primitive.i128#method.saturating_abs "i128::saturating_abs"). ##### Example ``` let pos = NonZeroI128::new(1)?; let neg = NonZeroI128::new(-1)?; let min = NonZeroI128::new(i128::MIN)?; let min_plus = NonZeroI128::new(i128::MIN + 1)?; let max = NonZeroI128::new(i128::MAX)?; assert_eq!(pos, pos.saturating_abs()); assert_eq!(pos, neg.saturating_abs()); assert_eq!(max, min.saturating_abs()); assert_eq!(max, min_plus.saturating_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn wrapping\_abs(self) -> NonZeroI128 Wrapping absolute value, see [`i128::wrapping_abs`](../primitive.i128#method.wrapping_abs "i128::wrapping_abs"). ##### Example ``` let pos = NonZeroI128::new(1)?; let neg = NonZeroI128::new(-1)?; let min = NonZeroI128::new(i128::MIN)?; let max = NonZeroI128::new(i128::MAX)?; assert_eq!(pos, pos.wrapping_abs()); assert_eq!(pos, neg.wrapping_abs()); assert_eq!(min, min.wrapping_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn unsigned\_abs(self) -> NonZeroU128 Computes the absolute value of self without any wrapping or panicking. ##### Example ``` let u_pos = NonZeroU128::new(1)?; let i_pos = NonZeroI128::new(1)?; let i_neg = NonZeroI128::new(-1)?; let i_min = NonZeroI128::new(i128::MIN)?; let u_max = NonZeroU128::new(u128::MAX / 2 + 1)?; assert_eq!(u_pos, i_pos.unsigned_abs()); assert_eq!(u_pos, i_neg.unsigned_abs()); assert_eq!(u_max, i_min.unsigned_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroI128) -> Option<NonZeroI128> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroI128::new(2)?; let four = NonZeroI128::new(4)?; let max = NonZeroI128::new(i128::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroI128) -> NonZeroI128 Multiplies two non-zero integers together. Return [`i128::MAX`](../primitive.i128#associatedconstant.MAX "i128::MAX") on overflow. ##### Examples ``` let two = NonZeroI128::new(2)?; let four = NonZeroI128::new(4)?; let max = NonZeroI128::new(i128::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroI128) -> NonZeroI128 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > i128::MAX`, or `self * rhs < i128::MIN`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroI128::new(2)?; let four = NonZeroI128::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroI128> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroI128::new(3)?; let twenty_seven = NonZeroI128::new(27)?; let half_max = NonZeroI128::new(i128::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroI128 Raise non-zero value to an integer power. Return [`i128::MIN`](../primitive.i128#associatedconstant.MIN "i128::MIN") or [`i128::MAX`](../primitive.i128#associatedconstant.MAX "i128::MAX") on overflow. ##### Examples ``` let three = NonZeroI128::new(3)?; let twenty_seven = NonZeroI128::new(27)?; let max = NonZeroI128::new(i128::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)### impl NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MIN: NonZeroI128 = Self::new(i128::MIN).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, equal to [`i128::MIN`](../primitive.i128#associatedconstant.MIN "i128::MIN"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI128::MIN.get(), i128::MIN); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MAX: NonZeroI128 = Self::new(i128::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`i128::MAX`](../primitive.i128#associatedconstant.MAX "i128::MAX"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI128::MAX.get(), i128::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 128u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`i128::BITS`](../primitive.i128#associatedconstant.BITS "i128::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroI128::BITS, i128::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI128> for NonZeroI128 #### type Output = NonZeroI128 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI128) -> <NonZeroI128 as BitOr<NonZeroI128>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI128> for i128 #### type Output = NonZeroI128 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI128) -> <i128 as BitOr<NonZeroI128>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i128> for NonZeroI128 #### type Output = NonZeroI128 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: i128) -> <NonZeroI128 as BitOr<i128>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroI128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: i128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroI128 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI128> for i128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroI128) -> i128 Converts a `NonZeroI128` into an `i128` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#440)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#440)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroI128 Converts `NonZeroI16` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#443)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI32> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#443)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI32) -> NonZeroI128 Converts `NonZeroI32` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#444)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI64> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#444)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI64) -> NonZeroI128 Converts `NonZeroI64` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#436)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#436)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI128 Converts `NonZeroI8` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#454)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#454)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroI128 Converts `NonZeroU16` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#456)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#456)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroI128 Converts `NonZeroU32` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#457)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU64> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#457)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU64) -> NonZeroI128 Converts `NonZeroU64` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#450)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#450)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI128 Converts `NonZeroU8` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroI128 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroI128, <NonZeroI128 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroI128) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroI128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroI128) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroI128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroI128) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#497)1.46.0 · ### impl TryFrom<i128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#497)#### fn try\_from( value: i128) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<i128>>::Error> Attempts to convert `i128` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroI128 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroI128 ### impl Send for NonZeroI128 ### impl Sync for NonZeroI128 ### impl Unpin for NonZeroI128 ### impl UnwindSafe for NonZeroI128 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::TryFromIntError Struct std::num::TryFromIntError ================================ ``` pub struct TryFromIntError(_); ``` The error type returned when a checked integral type conversion fails. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl Clone for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)#### fn clone(&self) -> TryFromIntError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl Debug for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#27)### impl Display for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#28)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#161)### impl Error for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#163)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#42)### impl From<!> for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#43)#### const fn from(never: !) -> TryFromIntError Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/num/error.rs.html#35)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl From<Infallible> for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#36)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(x: Infallible) -> TryFromIntError Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl PartialEq<TryFromIntError> for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)#### fn eq(&self, other: &TryFromIntError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl Copy for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl Eq for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl StructuralEq for TryFromIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)### impl StructuralPartialEq for TryFromIntError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for TryFromIntError ### impl Send for TryFromIntError ### impl Sync for TryFromIntError ### impl Unpin for TryFromIntError ### impl UnwindSafe for TryFromIntError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::num Module std::num =============== Additional functionality for numerics. This module provides some extra types that are useful when doing numerical work. See the individual documentation for each piece for more information. Structs ------- [Saturating](struct.saturating "std::num::Saturating struct")Experimental Provides intentionally-saturating arithmetic on `T`. [NonZeroI8](struct.nonzeroi8 "std::num::NonZeroI8 struct") An integer that is known not to equal zero. [NonZeroI16](struct.nonzeroi16 "std::num::NonZeroI16 struct") An integer that is known not to equal zero. [NonZeroI32](struct.nonzeroi32 "std::num::NonZeroI32 struct") An integer that is known not to equal zero. [NonZeroI64](struct.nonzeroi64 "std::num::NonZeroI64 struct") An integer that is known not to equal zero. [NonZeroI128](struct.nonzeroi128 "std::num::NonZeroI128 struct") An integer that is known not to equal zero. [NonZeroIsize](struct.nonzeroisize "std::num::NonZeroIsize struct") An integer that is known not to equal zero. [NonZeroU8](struct.nonzerou8 "std::num::NonZeroU8 struct") An integer that is known not to equal zero. [NonZeroU16](struct.nonzerou16 "std::num::NonZeroU16 struct") An integer that is known not to equal zero. [NonZeroU32](struct.nonzerou32 "std::num::NonZeroU32 struct") An integer that is known not to equal zero. [NonZeroU64](struct.nonzerou64 "std::num::NonZeroU64 struct") An integer that is known not to equal zero. [NonZeroU128](struct.nonzerou128 "std::num::NonZeroU128 struct") An integer that is known not to equal zero. [NonZeroUsize](struct.nonzerousize "std::num::NonZeroUsize struct") An integer that is known not to equal zero. [ParseFloatError](struct.parsefloaterror "std::num::ParseFloatError struct") An error which can be returned when parsing a float. [ParseIntError](struct.parseinterror "std::num::ParseIntError struct") An error which can be returned when parsing an integer. [TryFromIntError](struct.tryfrominterror "std::num::TryFromIntError struct") The error type returned when a checked integral type conversion fails. [Wrapping](struct.wrapping "std::num::Wrapping struct") Provides intentionally-wrapped arithmetic on `T`. Enums ----- [FpCategory](enum.fpcategory "std::num::FpCategory enum") A classification of floating point numbers. [IntErrorKind](enum.interrorkind "std::num::IntErrorKind enum") Enum to store the various types of errors that can cause parsing an integer to fail. rust Struct std::num::Wrapping Struct std::num::Wrapping ========================= ``` #[repr(transparent)]pub struct Wrapping<T>(pub T); ``` Provides intentionally-wrapped arithmetic on `T`. Operations like `+` on `u32` values are intended to never overflow, and in some debug configurations overflow is detected and results in a panic. While most arithmetic falls into this category, some code explicitly expects and relies upon modular arithmetic (e.g., hashing). Wrapping arithmetic can be achieved either through methods like `wrapping_add`, or through the `Wrapping<T>` type, which says that all standard arithmetic operations on the underlying value are intended to have wrapping semantics. The underlying value can be retrieved through the `.0` index of the `Wrapping` tuple. Examples -------- ``` use std::num::Wrapping; let zero = Wrapping(0u32); let one = Wrapping(1u32); assert_eq!(u32::MAX, (zero - one).0); ``` Layout ------ `Wrapping<T>` is guaranteed to have the same layout and ABI as `T`. Tuple Fields ------------ `0: T`Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<usize> = Self(usize::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<usize>>::MIN, Wrapping(usize::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<usize> = Self(usize::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<usize>>::MAX, Wrapping(usize::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<usize>>::BITS, usize::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100usize); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0usize).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000usize); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<usize> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<usize>) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ausize); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<usize>>::from_be(n), n) } else { assert_eq!(<Wrapping<usize>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<usize>) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ausize); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<usize>>::from_le(n), n) } else { assert_eq!(<Wrapping<usize>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ausize); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ausize); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3usize).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<u8> = Self(u8::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u8>>::MIN, Wrapping(u8::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<u8> = Self(u8::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u8>>::MAX, Wrapping(u8::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 8u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u8>>::BITS, u8::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100u8); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0u8).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000u8); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<u8> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<u8>) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au8); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<u8>>::from_be(n), n) } else { assert_eq!(<Wrapping<u8>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<u8>) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au8); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<u8>>::from_le(n), n) } else { assert_eq!(<Wrapping<u8>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au8); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au8); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3u8).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<u16> = Self(u16::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u16>>::MIN, Wrapping(u16::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<u16> = Self(u16::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u16>>::MAX, Wrapping(u16::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 16u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u16>>::BITS, u16::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100u16); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0u16).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000u16); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<u16> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<u16>) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au16); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<u16>>::from_be(n), n) } else { assert_eq!(<Wrapping<u16>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<u16>) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au16); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<u16>>::from_le(n), n) } else { assert_eq!(<Wrapping<u16>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au16); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au16); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3u16).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<u32> = Self(u32::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u32>>::MIN, Wrapping(u32::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<u32> = Self(u32::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u32>>::MAX, Wrapping(u32::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 32u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u32>>::BITS, u32::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100u32); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0u32).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000u32); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<u32> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<u32>) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au32); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<u32>>::from_be(n), n) } else { assert_eq!(<Wrapping<u32>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<u32>) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au32); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<u32>>::from_le(n), n) } else { assert_eq!(<Wrapping<u32>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au32); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au32); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3u32).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<u64> = Self(u64::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u64>>::MIN, Wrapping(u64::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<u64> = Self(u64::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u64>>::MAX, Wrapping(u64::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u64>>::BITS, u64::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100u64); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0u64).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000u64); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<u64> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<u64>) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au64); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<u64>>::from_be(n), n) } else { assert_eq!(<Wrapping<u64>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<u64>) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au64); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<u64>>::from_le(n), n) } else { assert_eq!(<Wrapping<u64>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au64); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au64); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3u64).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<u128> = Self(u128::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u128>>::MIN, Wrapping(u128::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<u128> = Self(u128::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u128>>::MAX, Wrapping(u128::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 128u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<u128>>::BITS, u128::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100u128); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0u128).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000u128); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<u128> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<u128>) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au128); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<u128>>::from_be(n), n) } else { assert_eq!(<Wrapping<u128>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<u128>) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au128); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<u128>>::from_le(n), n) } else { assert_eq!(<Wrapping<u128>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au128); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Au128); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3u128).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<isize> = Self(isize::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<isize>>::MIN, Wrapping(isize::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<isize> = Self(isize::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<isize>>::MAX, Wrapping(isize::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<isize>>::BITS, isize::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100isize); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0isize).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000isize); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<isize> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<isize>) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Aisize); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<isize>>::from_be(n), n) } else { assert_eq!(<Wrapping<isize>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<isize>) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Aisize); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<isize>>::from_le(n), n) } else { assert_eq!(<Wrapping<isize>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Aisize); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Aisize); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3isize).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<i8> = Self(i8::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i8>>::MIN, Wrapping(i8::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<i8> = Self(i8::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i8>>::MAX, Wrapping(i8::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 8u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i8>>::BITS, i8::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100i8); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0i8).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000i8); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<i8> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<i8>) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai8); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<i8>>::from_be(n), n) } else { assert_eq!(<Wrapping<i8>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<i8>) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai8); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<i8>>::from_le(n), n) } else { assert_eq!(<Wrapping<i8>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai8); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai8); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<i16> = Self(i16::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i16>>::MIN, Wrapping(i16::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<i16> = Self(i16::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i16>>::MAX, Wrapping(i16::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 16u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i16>>::BITS, i16::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100i16); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0i16).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000i16); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<i16> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<i16>) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai16); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<i16>>::from_be(n), n) } else { assert_eq!(<Wrapping<i16>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<i16>) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai16); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<i16>>::from_le(n), n) } else { assert_eq!(<Wrapping<i16>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai16); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai16); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i16).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<i32> = Self(i32::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i32>>::MIN, Wrapping(i32::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<i32> = Self(i32::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i32>>::MAX, Wrapping(i32::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 32u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i32>>::BITS, i32::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100i32); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0i32).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000i32); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<i32> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<i32>) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai32); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<i32>>::from_be(n), n) } else { assert_eq!(<Wrapping<i32>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<i32>) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai32); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<i32>>::from_le(n), n) } else { assert_eq!(<Wrapping<i32>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai32); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai32); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i32).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<i64> = Self(i64::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i64>>::MIN, Wrapping(i64::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<i64> = Self(i64::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i64>>::MAX, Wrapping(i64::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i64>>::BITS, i64::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100i64); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0i64).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000i64); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<i64> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<i64>) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai64); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<i64>>::from_be(n), n) } else { assert_eq!(<Wrapping<i64>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<i64>) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai64); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<i64>>::from_le(n), n) } else { assert_eq!(<Wrapping<i64>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai64); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai64); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i64).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)### impl Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MIN: Wrapping<i128> = Self(i128::MIN) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i128>>::MIN, Wrapping(i128::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const MAX: Wrapping<i128> = Self(i128::MAX) 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i128>>::MAX, Wrapping(i128::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const BITS: u32 = 128u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(<Wrapping<i128>>::BITS, i128::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b01001100i128); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(!0i128).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0b0101000i128); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_left(self, n: u32) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the left by a specified amount, `n`, wrapping the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn rotate\_right(self, n: u32) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Shifts the bits to the right by a specified amount, `n`, wrapping the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i64> = Wrapping(0x0123456789ABCDEF); let m: Wrapping<i64> = Wrapping(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn swap\_bytes(self) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n: Wrapping<i16> = Wrapping(0b0000000_01010101); assert_eq!(n, Wrapping(85)); let m = n.swap_bytes(); assert_eq!(m, Wrapping(0b01010101_00000000)); assert_eq!(m, Wrapping(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> Wrapping<i128> Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` use std::num::Wrapping; let n = Wrapping(0b0000000_01010101i16); assert_eq!(n, Wrapping(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Wrapping(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_be(x: Wrapping<i128>) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai128); if cfg!(target_endian = "big") { assert_eq!(<Wrapping<i128>>::from_be(n), n) } else { assert_eq!(<Wrapping<i128>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn from\_le(x: Wrapping<i128>) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai128); if cfg!(target_endian = "little") { assert_eq!(<Wrapping<i128>>::from_le(n), n) } else { assert_eq!(<Wrapping<i128>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_be(self) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai128); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub const fn to\_le(self) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(0x1Ai128); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#885)#### pub fn pow(self, exp: u32) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i128).pow(4), Wrapping(81)); ``` Results that are too large are wrapped: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(3i8).pow(5), Wrapping(-13)); assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)### impl Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(isize::MAX) >> 2; assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn abs(self) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Computes the absolute value of `self`, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one takes the absolute value of the negative minimal value for the type this is a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(100isize).abs(), Wrapping(100)); assert_eq!(Wrapping(-100isize).abs(), Wrapping(100)); assert_eq!(Wrapping(isize::MIN).abs(), Wrapping(isize::MIN)); assert_eq!(Wrapping(-128i8).abs().0 as u8, 128u8); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn signum(self) -> Wrapping<isize> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(10isize).signum(), Wrapping(1)); assert_eq!(Wrapping(0isize).signum(), Wrapping(0)); assert_eq!(Wrapping(-10isize).signum(), Wrapping(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(10isize).is_positive()); assert!(!Wrapping(-10isize).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(-10isize).is_negative()); assert!(!Wrapping(10isize).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)### impl Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(i8::MAX) >> 2; assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn abs(self) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Computes the absolute value of `self`, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one takes the absolute value of the negative minimal value for the type this is a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(100i8).abs(), Wrapping(100)); assert_eq!(Wrapping(-100i8).abs(), Wrapping(100)); assert_eq!(Wrapping(i8::MIN).abs(), Wrapping(i8::MIN)); assert_eq!(Wrapping(-128i8).abs().0 as u8, 128u8); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn signum(self) -> Wrapping<i8> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(10i8).signum(), Wrapping(1)); assert_eq!(Wrapping(0i8).signum(), Wrapping(0)); assert_eq!(Wrapping(-10i8).signum(), Wrapping(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(10i8).is_positive()); assert!(!Wrapping(-10i8).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(-10i8).is_negative()); assert!(!Wrapping(10i8).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)### impl Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(i16::MAX) >> 2; assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn abs(self) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Computes the absolute value of `self`, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one takes the absolute value of the negative minimal value for the type this is a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(100i16).abs(), Wrapping(100)); assert_eq!(Wrapping(-100i16).abs(), Wrapping(100)); assert_eq!(Wrapping(i16::MIN).abs(), Wrapping(i16::MIN)); assert_eq!(Wrapping(-128i8).abs().0 as u8, 128u8); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn signum(self) -> Wrapping<i16> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(10i16).signum(), Wrapping(1)); assert_eq!(Wrapping(0i16).signum(), Wrapping(0)); assert_eq!(Wrapping(-10i16).signum(), Wrapping(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(10i16).is_positive()); assert!(!Wrapping(-10i16).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(-10i16).is_negative()); assert!(!Wrapping(10i16).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)### impl Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(i32::MAX) >> 2; assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn abs(self) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Computes the absolute value of `self`, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one takes the absolute value of the negative minimal value for the type this is a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(100i32).abs(), Wrapping(100)); assert_eq!(Wrapping(-100i32).abs(), Wrapping(100)); assert_eq!(Wrapping(i32::MIN).abs(), Wrapping(i32::MIN)); assert_eq!(Wrapping(-128i8).abs().0 as u8, 128u8); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn signum(self) -> Wrapping<i32> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(10i32).signum(), Wrapping(1)); assert_eq!(Wrapping(0i32).signum(), Wrapping(0)); assert_eq!(Wrapping(-10i32).signum(), Wrapping(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(10i32).is_positive()); assert!(!Wrapping(-10i32).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(-10i32).is_negative()); assert!(!Wrapping(10i32).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)### impl Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(i64::MAX) >> 2; assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn abs(self) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Computes the absolute value of `self`, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one takes the absolute value of the negative minimal value for the type this is a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(100i64).abs(), Wrapping(100)); assert_eq!(Wrapping(-100i64).abs(), Wrapping(100)); assert_eq!(Wrapping(i64::MIN).abs(), Wrapping(i64::MIN)); assert_eq!(Wrapping(-128i8).abs().0 as u8, 128u8); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn signum(self) -> Wrapping<i64> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(10i64).signum(), Wrapping(1)); assert_eq!(Wrapping(0i64).signum(), Wrapping(0)); assert_eq!(Wrapping(-10i64).signum(), Wrapping(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(10i64).is_positive()); assert!(!Wrapping(-10i64).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(-10i64).is_negative()); assert!(!Wrapping(10i64).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)### impl Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(i128::MAX) >> 2; assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn abs(self) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Computes the absolute value of `self`, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one takes the absolute value of the negative minimal value for the type this is a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(100i128).abs(), Wrapping(100)); assert_eq!(Wrapping(-100i128).abs(), Wrapping(100)); assert_eq!(Wrapping(i128::MIN).abs(), Wrapping(i128::MIN)); assert_eq!(Wrapping(-128i8).abs().0 as u8, 128u8); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub fn signum(self) -> Wrapping<i128> 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert_eq!(Wrapping(10i128).signum(), Wrapping(1)); assert_eq!(Wrapping(0i128).signum(), Wrapping(0)); assert_eq!(Wrapping(-10i128).signum(), Wrapping(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(10i128).is_positive()); assert!(!Wrapping(-10i128).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1011)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(-10i128).is_negative()); assert!(!Wrapping(10i128).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)### impl Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(usize::MAX) >> 2; assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(16usize).is_power_of_two()); assert!(!Wrapping(10usize).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn next\_power\_of\_two(self) -> Wrapping<usize> 🔬This is a nightly-only experimental API. (`wrapping_next_power_of_two` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest power of two greater than or equal to `self`. When return value overflows (i.e., `self > (1 << (N-1))` for type `uN`), overflows to `2^N = 0`. ##### Examples Basic usage: ``` #![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2usize).next_power_of_two(), Wrapping(2)); assert_eq!(Wrapping(3usize).next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)### impl Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(u8::MAX) >> 2; assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(16u8).is_power_of_two()); assert!(!Wrapping(10u8).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn next\_power\_of\_two(self) -> Wrapping<u8> 🔬This is a nightly-only experimental API. (`wrapping_next_power_of_two` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest power of two greater than or equal to `self`. When return value overflows (i.e., `self > (1 << (N-1))` for type `uN`), overflows to `2^N = 0`. ##### Examples Basic usage: ``` #![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2u8).next_power_of_two(), Wrapping(2)); assert_eq!(Wrapping(3u8).next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)### impl Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(u16::MAX) >> 2; assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(16u16).is_power_of_two()); assert!(!Wrapping(10u16).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn next\_power\_of\_two(self) -> Wrapping<u16> 🔬This is a nightly-only experimental API. (`wrapping_next_power_of_two` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest power of two greater than or equal to `self`. When return value overflows (i.e., `self > (1 << (N-1))` for type `uN`), overflows to `2^N = 0`. ##### Examples Basic usage: ``` #![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2u16).next_power_of_two(), Wrapping(2)); assert_eq!(Wrapping(3u16).next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)### impl Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(u32::MAX) >> 2; assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(16u32).is_power_of_two()); assert!(!Wrapping(10u32).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn next\_power\_of\_two(self) -> Wrapping<u32> 🔬This is a nightly-only experimental API. (`wrapping_next_power_of_two` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest power of two greater than or equal to `self`. When return value overflows (i.e., `self > (1 << (N-1))` for type `uN`), overflows to `2^N = 0`. ##### Examples Basic usage: ``` #![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2u32).next_power_of_two(), Wrapping(2)); assert_eq!(Wrapping(3u32).next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)### impl Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(u64::MAX) >> 2; assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(16u64).is_power_of_two()); assert!(!Wrapping(10u64).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn next\_power\_of\_two(self) -> Wrapping<u64> 🔬This is a nightly-only experimental API. (`wrapping_next_power_of_two` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest power of two greater than or equal to `self`. When return value overflows (i.e., `self > (1 << (N-1))` for type `uN`), overflows to `2^N = 0`. ##### Examples Basic usage: ``` #![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2u64).next_power_of_two(), Wrapping(2)); assert_eq!(Wrapping(3u64).next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)### impl Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; let n = Wrapping(u128::MAX) >> 2; assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`wrapping_int_impl` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(wrapping_int_impl)] use std::num::Wrapping; assert!(Wrapping(16u128).is_power_of_two()); assert!(!Wrapping(10u128).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#1087)#### pub fn next\_power\_of\_two(self) -> Wrapping<u128> 🔬This is a nightly-only experimental API. (`wrapping_next_power_of_two` [#32463](https://github.com/rust-lang/rust/issues/32463)) Returns the smallest power of two greater than or equal to `self`. When return value overflows (i.e., `self > (1 << (N-1))` for type `uN`), overflows to `2^N = 0`. ##### Examples Basic usage: ``` #![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2u128).next_power_of_two(), Wrapping(2)); assert_eq!(Wrapping(3u128).next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Add<Wrapping<i128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Add<Wrapping<i128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Add<Wrapping<i128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Add<Wrapping<i128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Add<Wrapping<i16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Add<Wrapping<i16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Add<Wrapping<i16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Add<Wrapping<i16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Add<Wrapping<i32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Add<Wrapping<i32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Add<Wrapping<i32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Add<Wrapping<i32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Add<Wrapping<i64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Add<Wrapping<i64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Add<Wrapping<i64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Add<Wrapping<i64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Add<Wrapping<i8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Add<Wrapping<i8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Add<Wrapping<i8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Add<Wrapping<i8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Add<Wrapping<isize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Add<Wrapping<isize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Add<Wrapping<isize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Add<Wrapping<isize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Add<Wrapping<u128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Add<Wrapping<u128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Add<Wrapping<u128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Add<Wrapping<u128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Add<Wrapping<u16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Add<Wrapping<u16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Add<Wrapping<u16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Add<Wrapping<u16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Add<Wrapping<u32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Add<Wrapping<u32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Add<Wrapping<u32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Add<Wrapping<u32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Add<Wrapping<u64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Add<Wrapping<u64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Add<Wrapping<u64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Add<Wrapping<u64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Add<Wrapping<u8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Add<Wrapping<u8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Add<Wrapping<u8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Add<Wrapping<u8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Add<Wrapping<usize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Add<Wrapping<usize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Add<Wrapping<usize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Add<Wrapping<usize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Add<Wrapping<i128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<i128>) -> <Wrapping<i128> as Add<Wrapping<i128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Add<Wrapping<i16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<i16>) -> <Wrapping<i16> as Add<Wrapping<i16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Add<Wrapping<i32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<i32>) -> <Wrapping<i32> as Add<Wrapping<i32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Add<Wrapping<i64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<i64>) -> <Wrapping<i64> as Add<Wrapping<i64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Add<Wrapping<i8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<i8>) -> <Wrapping<i8> as Add<Wrapping<i8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Add<Wrapping<isize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<isize>) -> <Wrapping<isize> as Add<Wrapping<isize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Add<Wrapping<u128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<u128>) -> <Wrapping<u128> as Add<Wrapping<u128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Add<Wrapping<u16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<u16>) -> <Wrapping<u16> as Add<Wrapping<u16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Add<Wrapping<u32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<u32>) -> <Wrapping<u32> as Add<Wrapping<u32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Add<Wrapping<u64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<u64>) -> <Wrapping<u64> as Add<Wrapping<u64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Add<Wrapping<u8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<u8>) -> <Wrapping<u8> as Add<Wrapping<u8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Add<Wrapping<usize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add( self, other: Wrapping<usize>) -> <Wrapping<usize> as Add<Wrapping<usize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<i128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<i16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<i32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<i64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<i8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<isize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<u128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<u16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<u32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<u64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<u8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &Wrapping<usize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &i128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &i16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &i32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &i64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &i8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &isize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &u128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &u16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &u32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &u64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &u8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &usize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<i128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<i16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<i32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<i64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<i8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<isize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<u128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<u16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<u32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<u64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<u8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: Wrapping<usize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: i128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: i16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: i32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: i64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: i8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: isize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: u128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: u16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: u32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: u64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: u8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: usize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#59)1.11.0 · ### impl<T> Binary for Wrapping<T>where T: [Binary](../fmt/trait.binary "trait std::fmt::Binary"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#60)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i128>) -> <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i128>) -> <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i16>) -> <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i16>) -> <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i32>) -> <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i32>) -> <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i64>) -> <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i64>) -> <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i8>) -> <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<i8>) -> <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<isize>) -> <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<isize>) -> <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u128>) -> <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u128>) -> <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u16>) -> <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u16>) -> <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u32>) -> <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u32>) -> <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u64>) -> <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u64>) -> <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u8>) -> <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<u8>) -> <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<usize>) -> <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: &Wrapping<usize>) -> <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<i128>) -> <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<i16>) -> <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<i32>) -> <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<i64>) -> <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<i8>) -> <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<isize>) -> <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<u128>) -> <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<u16>) -> <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<u32>) -> <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<u64>) -> <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<u8>) -> <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand( self, other: Wrapping<usize>) -> <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<i128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<i16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<i32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<i64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<i8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<isize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<u128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<u16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<u32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<u64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<u8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &Wrapping<usize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &i128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &i16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &i32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &i64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &i8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &isize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &u128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &u16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &u32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &u64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &u8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &usize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<i128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<i16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<i32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<i64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<i8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<isize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<u128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<u16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<u32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<u64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<u8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: Wrapping<usize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: i128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: i16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: i32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: i64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: i8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: isize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: u128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: u16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: u32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: u64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: u8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: usize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i128>) -> <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i128>) -> <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i16>) -> <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i16>) -> <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i32>) -> <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i32>) -> <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i64>) -> <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i64>) -> <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i8>) -> <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<i8>) -> <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<isize>) -> <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<isize>) -> <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u128>) -> <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u128>) -> <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u16>) -> <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u16>) -> <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u32>) -> <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u32>) -> <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u64>) -> <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u64>) -> <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u8>) -> <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<u8>) -> <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<usize>) -> <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: &Wrapping<usize>) -> <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<i128>) -> <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<i16>) -> <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<i32>) -> <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<i64>) -> <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<i8>) -> <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<isize>) -> <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<u128>) -> <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<u16>) -> <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<u32>) -> <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<u64>) -> <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<u8>) -> <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, other: Wrapping<usize>) -> <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<i128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<i16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<i32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<i64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<i8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<isize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<u128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<u16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<u32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<u64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<u8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &Wrapping<usize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &i128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &i16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &i32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &i64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &i8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &isize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &u128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &u16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &u32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &u64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &u8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &usize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<i128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<i16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<i32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<i64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<i8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<isize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<u128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<u16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<u32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<u64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<u8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: Wrapping<usize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: i128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: i16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: i32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: i64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: i8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: isize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: u128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: u16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: u32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: u64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: u8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: usize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i128>) -> <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i128>) -> <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i16>) -> <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i16>) -> <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i32>) -> <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i32>) -> <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i64>) -> <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i64>) -> <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i8>) -> <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<i8>) -> <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<isize>) -> <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<isize>) -> <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u128>) -> <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u128>) -> <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u16>) -> <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u16>) -> <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u32>) -> <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u32>) -> <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u64>) -> <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u64>) -> <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u8>) -> <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<u8>) -> <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<usize>) -> <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: &Wrapping<usize>) -> <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<i128>) -> <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<i16>) -> <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<i32>) -> <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<i64>) -> <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<i8>) -> <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<isize>) -> <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<u128>) -> <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<u16>) -> <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<u32>) -> <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<u64>) -> <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<u8>) -> <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor( self, other: Wrapping<usize>) -> <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<i128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<i16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<i32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<i64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<i8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<isize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<u128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<u16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<u32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<u64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<u8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &Wrapping<usize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &i128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &i16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &i32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &i64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &i8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &isize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &u128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &u16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &u32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &u64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &u8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &usize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<i128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<i16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<i32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<i64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<i8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<isize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<u128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<u16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<u32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<u64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<u8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: Wrapping<usize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: i128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: i16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: i32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: i64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: i8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: isize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: u128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: u16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: u32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: u64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: u8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: usize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Clone for Wrapping<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)#### fn clone(&self) -> Wrapping<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#45)### impl<T> Debug for Wrapping<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#46)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Default for Wrapping<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)#### fn default() -> Wrapping<T> Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#52)1.10.0 · ### impl<T> Display for Wrapping<T>where T: [Display](../fmt/trait.display "trait std::fmt::Display"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#53)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Div<Wrapping<i128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Div<Wrapping<i128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Div<Wrapping<i128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Div<Wrapping<i128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Div<Wrapping<i16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Div<Wrapping<i16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Div<Wrapping<i16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Div<Wrapping<i16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Div<Wrapping<i32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Div<Wrapping<i32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Div<Wrapping<i32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Div<Wrapping<i32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Div<Wrapping<i64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Div<Wrapping<i64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Div<Wrapping<i64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Div<Wrapping<i64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Div<Wrapping<i8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Div<Wrapping<i8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Div<Wrapping<i8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Div<Wrapping<i8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Div<Wrapping<isize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Div<Wrapping<isize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Div<Wrapping<isize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Div<Wrapping<isize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Div<Wrapping<u128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Div<Wrapping<u128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Div<Wrapping<u128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Div<Wrapping<u128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Div<Wrapping<u16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Div<Wrapping<u16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Div<Wrapping<u16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Div<Wrapping<u16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Div<Wrapping<u32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Div<Wrapping<u32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Div<Wrapping<u32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Div<Wrapping<u32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Div<Wrapping<u64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Div<Wrapping<u64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Div<Wrapping<u64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Div<Wrapping<u64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Div<Wrapping<u8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Div<Wrapping<u8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Div<Wrapping<u8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Div<Wrapping<u8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Div<Wrapping<usize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Div<Wrapping<usize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Div<Wrapping<usize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Div<Wrapping<usize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Div<Wrapping<i128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<i128>) -> <Wrapping<i128> as Div<Wrapping<i128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Div<Wrapping<i16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<i16>) -> <Wrapping<i16> as Div<Wrapping<i16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Div<Wrapping<i32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<i32>) -> <Wrapping<i32> as Div<Wrapping<i32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Div<Wrapping<i64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<i64>) -> <Wrapping<i64> as Div<Wrapping<i64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Div<Wrapping<i8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<i8>) -> <Wrapping<i8> as Div<Wrapping<i8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Div<Wrapping<isize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<isize>) -> <Wrapping<isize> as Div<Wrapping<isize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Div<Wrapping<u128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<u128>) -> <Wrapping<u128> as Div<Wrapping<u128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Div<Wrapping<u16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<u16>) -> <Wrapping<u16> as Div<Wrapping<u16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Div<Wrapping<u32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<u32>) -> <Wrapping<u32> as Div<Wrapping<u32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Div<Wrapping<u64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<u64>) -> <Wrapping<u64> as Div<Wrapping<u64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Div<Wrapping<u8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<u8>) -> <Wrapping<u8> as Div<Wrapping<u8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Div<Wrapping<usize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div( self, other: Wrapping<usize>) -> <Wrapping<usize> as Div<Wrapping<usize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<i128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<i16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<i32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<i64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<i8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<isize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<u128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<u16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<u32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<u64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<u8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &Wrapping<usize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &i128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &i16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &i32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &i64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &i8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &isize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &u128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &u16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &u32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &u64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &u8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &usize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<i128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<i16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<i32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<i64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<i8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<isize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<u128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<u16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<u32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<u64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<u8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: Wrapping<usize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: i128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: i16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: i32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: i64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: i8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: isize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: u128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: u16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: u32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: u64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: u8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: usize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Hash for Wrapping<T>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#73)1.11.0 · ### impl<T> LowerHex for Wrapping<T>where T: [LowerHex](../fmt/trait.lowerhex "trait std::fmt::LowerHex"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#74)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Mul<Wrapping<i128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Mul<Wrapping<i128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Mul<Wrapping<i128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Mul<Wrapping<i128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Mul<Wrapping<i16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Mul<Wrapping<i16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Mul<Wrapping<i16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Mul<Wrapping<i16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Mul<Wrapping<i32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Mul<Wrapping<i32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Mul<Wrapping<i32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Mul<Wrapping<i32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Mul<Wrapping<i64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Mul<Wrapping<i64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Mul<Wrapping<i64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Mul<Wrapping<i64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Mul<Wrapping<i8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Mul<Wrapping<i8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Mul<Wrapping<i8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Mul<Wrapping<i8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Mul<Wrapping<isize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Mul<Wrapping<isize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Mul<Wrapping<isize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Mul<Wrapping<isize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Mul<Wrapping<u128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Mul<Wrapping<u128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Mul<Wrapping<u128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Mul<Wrapping<u128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Mul<Wrapping<u16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Mul<Wrapping<u16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Mul<Wrapping<u16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Mul<Wrapping<u16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Mul<Wrapping<u32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Mul<Wrapping<u32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Mul<Wrapping<u32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Mul<Wrapping<u32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Mul<Wrapping<u64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Mul<Wrapping<u64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Mul<Wrapping<u64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Mul<Wrapping<u64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Mul<Wrapping<u8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Mul<Wrapping<u8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Mul<Wrapping<u8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Mul<Wrapping<u8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Mul<Wrapping<usize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Mul<Wrapping<usize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Mul<Wrapping<usize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Mul<Wrapping<usize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Mul<Wrapping<i128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<i128>) -> <Wrapping<i128> as Mul<Wrapping<i128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Mul<Wrapping<i16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<i16>) -> <Wrapping<i16> as Mul<Wrapping<i16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Mul<Wrapping<i32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<i32>) -> <Wrapping<i32> as Mul<Wrapping<i32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Mul<Wrapping<i64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<i64>) -> <Wrapping<i64> as Mul<Wrapping<i64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Mul<Wrapping<i8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul(self, other: Wrapping<i8>) -> <Wrapping<i8> as Mul<Wrapping<i8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Mul<Wrapping<isize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<isize>) -> <Wrapping<isize> as Mul<Wrapping<isize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Mul<Wrapping<u128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<u128>) -> <Wrapping<u128> as Mul<Wrapping<u128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Mul<Wrapping<u16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<u16>) -> <Wrapping<u16> as Mul<Wrapping<u16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Mul<Wrapping<u32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<u32>) -> <Wrapping<u32> as Mul<Wrapping<u32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Mul<Wrapping<u64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<u64>) -> <Wrapping<u64> as Mul<Wrapping<u64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Mul<Wrapping<u8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul(self, other: Wrapping<u8>) -> <Wrapping<u8> as Mul<Wrapping<u8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Mul<Wrapping<usize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)#### fn mul( self, other: Wrapping<usize>) -> <Wrapping<usize> as Mul<Wrapping<usize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<i128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<i16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<i32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<i64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<i8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<isize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<u128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<u16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<u32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<u64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<u8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &Wrapping<usize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &i128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &i16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &i32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &i64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &i8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &isize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &u128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &u16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &u32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &u64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &u8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &usize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<i128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<i16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<i32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<i64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<i8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<isize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<u128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<u16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<u32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<u64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<u8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: Wrapping<usize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: i128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: i16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: i32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: i64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: i8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: isize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: u128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: u16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: u32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: u64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: u8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: usize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i128> #### type Output = <Wrapping<i128> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<i128> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i16> #### type Output = <Wrapping<i16> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<i16> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i32> #### type Output = <Wrapping<i32> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<i32> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i64> #### type Output = <Wrapping<i64> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<i64> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i8> #### type Output = <Wrapping<i8> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<i8> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<isize> #### type Output = <Wrapping<isize> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<isize> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u128> #### type Output = <Wrapping<u128> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<u128> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u16> #### type Output = <Wrapping<u16> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<u16> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u32> #### type Output = <Wrapping<u32> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<u32> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u64> #### type Output = <Wrapping<u64> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<u64> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u8> #### type Output = <Wrapping<u8> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<u8> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<usize> #### type Output = <Wrapping<usize> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> <Wrapping<usize> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<i128> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<i16> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<i32> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<i64> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<i8> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<isize> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<u128> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<u16> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<u32> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<u64> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<u8> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn neg(self) -> Wrapping<usize> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i128> #### type Output = <Wrapping<i128> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<i128> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i16> #### type Output = <Wrapping<i16> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<i16> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i32> #### type Output = <Wrapping<i32> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<i32> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i64> #### type Output = <Wrapping<i64> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<i64> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i8> #### type Output = <Wrapping<i8> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<i8> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<isize> #### type Output = <Wrapping<isize> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<isize> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u128> #### type Output = <Wrapping<u128> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<u128> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u16> #### type Output = <Wrapping<u16> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<u16> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u32> #### type Output = <Wrapping<u32> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<u32> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u64> #### type Output = <Wrapping<u64> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<u64> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u8> #### type Output = <Wrapping<u8> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<u8> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<usize> #### type Output = <Wrapping<usize> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> <Wrapping<usize> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<i128> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<i16> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<i32> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<i64> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<i8> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<isize> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<u128> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<u16> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<u32> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<u64> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<u8> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> Wrapping<usize> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#66)1.11.0 · ### impl<T> Octal for Wrapping<T>where T: [Octal](../fmt/trait.octal "trait std::fmt::Octal"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#67)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Ord for Wrapping<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)#### fn cmp(&self, other: &Wrapping<T>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> PartialEq<Wrapping<T>> for Wrapping<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)#### fn eq(&self, other: &Wrapping<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> PartialOrd<Wrapping<T>> for Wrapping<T>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)#### fn partial\_cmp(&self, other: &Wrapping<T>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i128](../primitive.i128)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i16](../primitive.i16)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i32](../primitive.i32)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i64](../primitive.i64)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i8](../primitive.i8)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<isize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[isize](../primitive.isize)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u128](../primitive.u128)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u16](../primitive.u16)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u32](../primitive.u32)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u64](../primitive.u64)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u8](../primitive.u8)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Product<&'a Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<usize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[usize](../primitive.usize)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i128](../primitive.i128)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i16](../primitive.i16)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i32](../primitive.i32)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i64](../primitive.i64)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<i8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i8](../primitive.i8)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<isize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[isize](../primitive.isize)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u128](../primitive.u128)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u16](../primitive.u16)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u32](../primitive.u32)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u64](../primitive.u64)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<u8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u8](../primitive.u8)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Product<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> Wrapping<usize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[usize](../primitive.usize)>>, Method which takes an iterator and generates `Self` from the elements by multiplying the items. [Read more](../iter/trait.product#tymethod.product) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Rem<Wrapping<i128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Rem<Wrapping<i128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Rem<Wrapping<i128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Rem<Wrapping<i128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Rem<Wrapping<i16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Rem<Wrapping<i16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Rem<Wrapping<i16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Rem<Wrapping<i16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Rem<Wrapping<i32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Rem<Wrapping<i32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Rem<Wrapping<i32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Rem<Wrapping<i32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Rem<Wrapping<i64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Rem<Wrapping<i64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Rem<Wrapping<i64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Rem<Wrapping<i64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Rem<Wrapping<i8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Rem<Wrapping<i8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Rem<Wrapping<i8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Rem<Wrapping<i8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Rem<Wrapping<isize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Rem<Wrapping<isize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Rem<Wrapping<isize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Rem<Wrapping<isize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Rem<Wrapping<u128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Rem<Wrapping<u128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Rem<Wrapping<u128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Rem<Wrapping<u128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Rem<Wrapping<u16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Rem<Wrapping<u16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Rem<Wrapping<u16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Rem<Wrapping<u16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Rem<Wrapping<u32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Rem<Wrapping<u32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Rem<Wrapping<u32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Rem<Wrapping<u32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Rem<Wrapping<u64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Rem<Wrapping<u64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Rem<Wrapping<u64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Rem<Wrapping<u64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Rem<Wrapping<u8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Rem<Wrapping<u8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Rem<Wrapping<u8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Rem<Wrapping<u8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Rem<Wrapping<usize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Rem<Wrapping<usize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Rem<Wrapping<usize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Rem<Wrapping<usize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Rem<Wrapping<i128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<i128>) -> <Wrapping<i128> as Rem<Wrapping<i128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Rem<Wrapping<i16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<i16>) -> <Wrapping<i16> as Rem<Wrapping<i16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Rem<Wrapping<i32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<i32>) -> <Wrapping<i32> as Rem<Wrapping<i32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Rem<Wrapping<i64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<i64>) -> <Wrapping<i64> as Rem<Wrapping<i64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Rem<Wrapping<i8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<i8>) -> <Wrapping<i8> as Rem<Wrapping<i8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Rem<Wrapping<isize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<isize>) -> <Wrapping<isize> as Rem<Wrapping<isize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Rem<Wrapping<u128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<u128>) -> <Wrapping<u128> as Rem<Wrapping<u128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Rem<Wrapping<u16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<u16>) -> <Wrapping<u16> as Rem<Wrapping<u16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Rem<Wrapping<u32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<u32>) -> <Wrapping<u32> as Rem<Wrapping<u32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Rem<Wrapping<u64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<u64>) -> <Wrapping<u64> as Rem<Wrapping<u64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Rem<Wrapping<u8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<u8>) -> <Wrapping<u8> as Rem<Wrapping<u8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Rem<Wrapping<usize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem( self, other: Wrapping<usize>) -> <Wrapping<usize> as Rem<Wrapping<usize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<i128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<i16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<i32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<i64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<i8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<isize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<u128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<u16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<u32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<u64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<u8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &Wrapping<usize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &i128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &i16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &i32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &i64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &i8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &isize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &u128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &u16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &u32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &u64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &u8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &usize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<i128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<i16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<i32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<i64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<i8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<isize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<u128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<u16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<u32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<u64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<u8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: Wrapping<usize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: i128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: i16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: i32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: i64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: i8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: isize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: u128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: u16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: u32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: u64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: u8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: usize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<isize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<usize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i128> #### type Output = <Wrapping<i128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i16> #### type Output = <Wrapping<i16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i32> #### type Output = <Wrapping<i32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i64> #### type Output = <Wrapping<i64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i8> #### type Output = <Wrapping<i8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<i8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<isize> #### type Output = <Wrapping<isize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<isize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u128> #### type Output = <Wrapping<u128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u16> #### type Output = <Wrapping<u16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u32> #### type Output = <Wrapping<u32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u64> #### type Output = <Wrapping<u64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u8> #### type Output = <Wrapping<u8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<u8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<usize> #### type Output = <Wrapping<usize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <Wrapping<usize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<i128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<i16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<i32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<i64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<i8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<isize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<u128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<u16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<u32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<u64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<u8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <Wrapping<usize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<i128> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<i16> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<i32> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<i64> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<i8> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<isize> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<u128> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<u16> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<u32> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<u64> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<u8> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> Wrapping<usize> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<isize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<usize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i128> #### type Output = <Wrapping<i128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i16> #### type Output = <Wrapping<i16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i32> #### type Output = <Wrapping<i32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i64> #### type Output = <Wrapping<i64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i8> #### type Output = <Wrapping<i8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<i8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<isize> #### type Output = <Wrapping<isize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<isize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u128> #### type Output = <Wrapping<u128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u16> #### type Output = <Wrapping<u16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u32> #### type Output = <Wrapping<u32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u64> #### type Output = <Wrapping<u64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u8> #### type Output = <Wrapping<u8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<u8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<usize> #### type Output = <Wrapping<usize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <Wrapping<usize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<i128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<i16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<i32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<i64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<i8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<isize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<u128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<u16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<u32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<u64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<u8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <Wrapping<usize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<i128> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<i16> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<i32> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<i64> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<i8> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<isize> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<u128> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<u16> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<u32> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<u64> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<u8> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> Wrapping<usize> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Sub<Wrapping<i128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Sub<Wrapping<i128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Sub<Wrapping<i128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i128>) -> <Wrapping<i128> as Sub<Wrapping<i128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Sub<Wrapping<i16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Sub<Wrapping<i16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Sub<Wrapping<i16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i16>) -> <Wrapping<i16> as Sub<Wrapping<i16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Sub<Wrapping<i32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Sub<Wrapping<i32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Sub<Wrapping<i32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i32>) -> <Wrapping<i32> as Sub<Wrapping<i32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Sub<Wrapping<i64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Sub<Wrapping<i64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Sub<Wrapping<i64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<i64>) -> <Wrapping<i64> as Sub<Wrapping<i64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Sub<Wrapping<i8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Sub<Wrapping<i8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Sub<Wrapping<i8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: &Wrapping<i8>) -> <Wrapping<i8> as Sub<Wrapping<i8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Sub<Wrapping<isize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Sub<Wrapping<isize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Sub<Wrapping<isize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<isize>) -> <Wrapping<isize> as Sub<Wrapping<isize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Sub<Wrapping<u128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Sub<Wrapping<u128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Sub<Wrapping<u128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u128>) -> <Wrapping<u128> as Sub<Wrapping<u128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Sub<Wrapping<u16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Sub<Wrapping<u16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Sub<Wrapping<u16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u16>) -> <Wrapping<u16> as Sub<Wrapping<u16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Sub<Wrapping<u32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Sub<Wrapping<u32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Sub<Wrapping<u32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u32>) -> <Wrapping<u32> as Sub<Wrapping<u32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Sub<Wrapping<u64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Sub<Wrapping<u64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Sub<Wrapping<u64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<u64>) -> <Wrapping<u64> as Sub<Wrapping<u64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Sub<Wrapping<u8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Sub<Wrapping<u8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Sub<Wrapping<u8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: &Wrapping<u8>) -> <Wrapping<u8> as Sub<Wrapping<u8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Sub<Wrapping<usize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Sub<Wrapping<usize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Sub<Wrapping<usize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: &Wrapping<usize>) -> <Wrapping<usize> as Sub<Wrapping<usize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Sub<Wrapping<i128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<i128>) -> <Wrapping<i128> as Sub<Wrapping<i128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<i128>) -> Wrapping<i128> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Sub<Wrapping<i16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<i16>) -> <Wrapping<i16> as Sub<Wrapping<i16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<i16>) -> Wrapping<i16> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Sub<Wrapping<i32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<i32>) -> <Wrapping<i32> as Sub<Wrapping<i32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<i32>) -> Wrapping<i32> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Sub<Wrapping<i64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<i64>) -> <Wrapping<i64> as Sub<Wrapping<i64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<i64>) -> Wrapping<i64> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Sub<Wrapping<i8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<i8>) -> <Wrapping<i8> as Sub<Wrapping<i8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<i8>) -> Wrapping<i8> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Sub<Wrapping<isize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<isize>) -> <Wrapping<isize> as Sub<Wrapping<isize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<isize>) -> Wrapping<isize> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Sub<Wrapping<u128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<u128>) -> <Wrapping<u128> as Sub<Wrapping<u128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<u128>) -> Wrapping<u128> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Sub<Wrapping<u16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<u16>) -> <Wrapping<u16> as Sub<Wrapping<u16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<u16>) -> Wrapping<u16> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Sub<Wrapping<u32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<u32>) -> <Wrapping<u32> as Sub<Wrapping<u32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<u32>) -> Wrapping<u32> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Sub<Wrapping<u64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<u64>) -> <Wrapping<u64> as Sub<Wrapping<u64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<u64>) -> Wrapping<u64> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Sub<Wrapping<u8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<u8>) -> <Wrapping<u8> as Sub<Wrapping<u8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<u8>) -> Wrapping<u8> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Sub<Wrapping<usize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub( self, other: Wrapping<usize>) -> <Wrapping<usize> as Sub<Wrapping<usize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub(self, other: Wrapping<usize>) -> Wrapping<usize> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<i128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<i16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<i32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<i64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<i8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<isize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<u128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<u16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<u32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<u64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<u8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &Wrapping<usize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &i128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &i16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &i32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &i64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &i8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &isize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &u128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &u16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &u32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &u64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &u8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &usize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<i128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<i16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<i32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<i64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<i8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<isize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<u128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<u16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<u32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<u64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<u8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.8.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: Wrapping<usize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: i128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: i16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: i32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: i64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: i8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: isize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: u128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: u16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: u32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: u64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: u8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: usize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i128](../primitive.i128)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i16](../primitive.i16)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i32](../primitive.i32)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i64](../primitive.i64)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i8](../primitive.i8)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<isize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[isize](../primitive.isize)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u128](../primitive.u128)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u16](../primitive.u16)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u32](../primitive.u32)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u64](../primitive.u64)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u8](../primitive.u8)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl<'a> Sum<&'a Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<usize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Wrapping](struct.wrapping "struct std::num::Wrapping")<[usize](../primitive.usize)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i128](../primitive.i128)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i16](../primitive.i16)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i32](../primitive.i32)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i64](../primitive.i64)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<i8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[i8](../primitive.i8)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<isize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[isize](../primitive.isize)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u128>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u128](../primitive.u128)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u16>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u16](../primitive.u16)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u32>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u32](../primitive.u32)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u64>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u64](../primitive.u64)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<u8>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[u8](../primitive.u8)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)1.14.0 · ### impl Sum<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> Wrapping<usize>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Wrapping](struct.wrapping "struct std::num::Wrapping")<[usize](../primitive.usize)>>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#80)1.11.0 · ### impl<T> UpperHex for Wrapping<T>where T: [UpperHex](../fmt/trait.upperhex "trait std::fmt::UpperHex"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#81)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Copy for Wrapping<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Eq for Wrapping<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> StructuralEq for Wrapping<T> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> StructuralPartialEq for Wrapping<T> Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Wrapping<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Wrapping<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Wrapping<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Wrapping<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Wrapping<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroI64 Struct std::num::NonZeroI64 =========================== ``` #[repr(transparent)]pub struct NonZeroI64(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroI64>` is the same size as `i64`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroI64>>(), size_of::<i64>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const unsafe fn new\_unchecked(n: i64) -> NonZeroI64 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: i64) -> Option<NonZeroI64> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> i64 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI64::new(-1i64).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI64::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)### impl NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn abs(self) -> NonZeroI64 Computes the absolute value of self. See [`i64::abs`](../primitive.i64#method.abs "i64::abs") for documentation on overflow behaviour. ##### Example ``` let pos = NonZeroI64::new(1)?; let neg = NonZeroI64::new(-1)?; assert_eq!(pos, pos.abs()); assert_eq!(pos, neg.abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn checked\_abs(self) -> Option<NonZeroI64> Checked absolute value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if `self == i64::MIN`. The result cannot be zero. ##### Example ``` let pos = NonZeroI64::new(1)?; let neg = NonZeroI64::new(-1)?; let min = NonZeroI64::new(i64::MIN)?; assert_eq!(Some(pos), neg.checked_abs()); assert_eq!(None, min.checked_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn overflowing\_abs(self) -> (NonZeroI64, bool) Computes the absolute value of self, with overflow information, see [`i64::overflowing_abs`](../primitive.i64#method.overflowing_abs "i64::overflowing_abs"). ##### Example ``` let pos = NonZeroI64::new(1)?; let neg = NonZeroI64::new(-1)?; let min = NonZeroI64::new(i64::MIN)?; assert_eq!((pos, false), pos.overflowing_abs()); assert_eq!((pos, false), neg.overflowing_abs()); assert_eq!((min, true), min.overflowing_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_abs(self) -> NonZeroI64 Saturating absolute value, see [`i64::saturating_abs`](../primitive.i64#method.saturating_abs "i64::saturating_abs"). ##### Example ``` let pos = NonZeroI64::new(1)?; let neg = NonZeroI64::new(-1)?; let min = NonZeroI64::new(i64::MIN)?; let min_plus = NonZeroI64::new(i64::MIN + 1)?; let max = NonZeroI64::new(i64::MAX)?; assert_eq!(pos, pos.saturating_abs()); assert_eq!(pos, neg.saturating_abs()); assert_eq!(max, min.saturating_abs()); assert_eq!(max, min_plus.saturating_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn wrapping\_abs(self) -> NonZeroI64 Wrapping absolute value, see [`i64::wrapping_abs`](../primitive.i64#method.wrapping_abs "i64::wrapping_abs"). ##### Example ``` let pos = NonZeroI64::new(1)?; let neg = NonZeroI64::new(-1)?; let min = NonZeroI64::new(i64::MIN)?; let max = NonZeroI64::new(i64::MAX)?; assert_eq!(pos, pos.wrapping_abs()); assert_eq!(pos, neg.wrapping_abs()); assert_eq!(min, min.wrapping_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn unsigned\_abs(self) -> NonZeroU64 Computes the absolute value of self without any wrapping or panicking. ##### Example ``` let u_pos = NonZeroU64::new(1)?; let i_pos = NonZeroI64::new(1)?; let i_neg = NonZeroI64::new(-1)?; let i_min = NonZeroI64::new(i64::MIN)?; let u_max = NonZeroU64::new(u64::MAX / 2 + 1)?; assert_eq!(u_pos, i_pos.unsigned_abs()); assert_eq!(u_pos, i_neg.unsigned_abs()); assert_eq!(u_max, i_min.unsigned_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroI64) -> Option<NonZeroI64> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroI64::new(2)?; let four = NonZeroI64::new(4)?; let max = NonZeroI64::new(i64::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroI64) -> NonZeroI64 Multiplies two non-zero integers together. Return [`i64::MAX`](../primitive.i64#associatedconstant.MAX "i64::MAX") on overflow. ##### Examples ``` let two = NonZeroI64::new(2)?; let four = NonZeroI64::new(4)?; let max = NonZeroI64::new(i64::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroI64) -> NonZeroI64 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > i64::MAX`, or `self * rhs < i64::MIN`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroI64::new(2)?; let four = NonZeroI64::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroI64> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroI64::new(3)?; let twenty_seven = NonZeroI64::new(27)?; let half_max = NonZeroI64::new(i64::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroI64 Raise non-zero value to an integer power. Return [`i64::MIN`](../primitive.i64#associatedconstant.MIN "i64::MIN") or [`i64::MAX`](../primitive.i64#associatedconstant.MAX "i64::MAX") on overflow. ##### Examples ``` let three = NonZeroI64::new(3)?; let twenty_seven = NonZeroI64::new(27)?; let max = NonZeroI64::new(i64::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)### impl NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MIN: NonZeroI64 = Self::new(i64::MIN).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, equal to [`i64::MIN`](../primitive.i64#associatedconstant.MIN "i64::MIN"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI64::MIN.get(), i64::MIN); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MAX: NonZeroI64 = Self::new(i64::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`i64::MAX`](../primitive.i64#associatedconstant.MAX "i64::MAX"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI64::MAX.get(), i64::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`i64::BITS`](../primitive.i64#associatedconstant.BITS "i64::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroI64::BITS, i64::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI64> for NonZeroI64 #### type Output = NonZeroI64 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI64) -> <NonZeroI64 as BitOr<NonZeroI64>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI64> for i64 #### type Output = NonZeroI64 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI64) -> <i64 as BitOr<NonZeroI64>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i64> for NonZeroI64 #### type Output = NonZeroI64 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: i64) -> <NonZeroI64 as BitOr<i64>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroI64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: i64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroI64 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#439)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#439)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroI64 Converts `NonZeroI16` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#442)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI32> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#442)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI32) -> NonZeroI64 Converts `NonZeroI32` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#444)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI64> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#444)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI64) -> NonZeroI128 Converts `NonZeroI64` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI64> for i64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroI64) -> i64 Converts a `NonZeroI64` into an `i64` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#435)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#435)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI64 Converts `NonZeroI8` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#453)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#453)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroI64 Converts `NonZeroU16` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#455)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#455)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroI64 Converts `NonZeroU32` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#449)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#449)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI64 Converts `NonZeroU8` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroI64 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroI64, <NonZeroI64 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroI64) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroI64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroI64) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroI64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroI64) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#496)1.46.0 · ### impl TryFrom<i64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#496)#### fn try\_from( value: i64) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<i64>>::Error> Attempts to convert `i64` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroI64 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroI64 ### impl Send for NonZeroI64 ### impl Sync for NonZeroI64 ### impl Unpin for NonZeroI64 ### impl UnwindSafe for NonZeroI64 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroU64 Struct std::num::NonZeroU64 =========================== ``` #[repr(transparent)]pub struct NonZeroU64(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroU64>` is the same size as `u64`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroU64>>(), size_of::<u64>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.28.0 · #### pub const unsafe fn new\_unchecked(n: u64) -> NonZeroU64 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: u64) -> Option<NonZeroU64> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> u64 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU64::new(u64::MAX).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU64::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_add(self, other: u64) -> Option<NonZeroU64> Adds an unsigned integer to a non-zero value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let one = NonZeroU64::new(1)?; let two = NonZeroU64::new(2)?; let max = NonZeroU64::new(u64::MAX)?; assert_eq!(Some(two), one.checked_add(1)); assert_eq!(None, max.checked_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_add(self, other: u64) -> NonZeroU64 Adds an unsigned integer to a non-zero value. Return [`u64::MAX`](../primitive.u64#associatedconstant.MAX "u64::MAX") on overflow. ##### Examples ``` let one = NonZeroU64::new(1)?; let two = NonZeroU64::new(2)?; let max = NonZeroU64::new(u64::MAX)?; assert_eq!(two, one.saturating_add(1)); assert_eq!(max, max.saturating_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const unsafe fn unchecked\_add(self, other: u64) -> NonZeroU64 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self + rhs > u64::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let one = NonZeroU64::new(1)?; let two = NonZeroU64::new(2)?; assert_eq!(two, unsafe { one.unchecked_add(1) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<NonZeroU64> Returns the smallest power of two greater than or equal to n. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if the next power of two is greater than the type’s maximum value. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU64::new(2)?; let three = NonZeroU64::new(3)?; let four = NonZeroU64::new(4)?; let max = NonZeroU64::new(u64::MAX)?; assert_eq!(Some(two), two.checked_next_power_of_two() ); assert_eq!(Some(four), three.checked_next_power_of_two() ); assert_eq!(None, max.checked_next_power_of_two() ); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog2(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 2 logarithm of the number, rounded down. This is the same operation as [`u64::ilog2`](../primitive.u64#method.ilog2 "u64::ilog2"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU64::new(7).unwrap().ilog2(), 2); assert_eq!(NonZeroU64::new(8).unwrap().ilog2(), 3); assert_eq!(NonZeroU64::new(9).unwrap().ilog2(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog10(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 10 logarithm of the number, rounded down. This is the same operation as [`u64::ilog10`](../primitive.u64#method.ilog10 "u64::ilog10"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU64::new(99).unwrap().ilog10(), 1); assert_eq!(NonZeroU64::new(100).unwrap().ilog10(), 2); assert_eq!(NonZeroU64::new(101).unwrap().ilog10(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroU64) -> Option<NonZeroU64> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU64::new(2)?; let four = NonZeroU64::new(4)?; let max = NonZeroU64::new(u64::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroU64) -> NonZeroU64 Multiplies two non-zero integers together. Return [`u64::MAX`](../primitive.u64#associatedconstant.MAX "u64::MAX") on overflow. ##### Examples ``` let two = NonZeroU64::new(2)?; let four = NonZeroU64::new(4)?; let max = NonZeroU64::new(u64::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroU64) -> NonZeroU64 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > u64::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroU64::new(2)?; let four = NonZeroU64::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroU64> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroU64::new(3)?; let twenty_seven = NonZeroU64::new(27)?; let half_max = NonZeroU64::new(u64::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroU64 Raise non-zero value to an integer power. Return [`u64::MAX`](../primitive.u64#associatedconstant.MAX "u64::MAX") on overflow. ##### Examples ``` let three = NonZeroU64::new(3)?; let twenty_seven = NonZeroU64::new(27)?; let max = NonZeroU64::new(u64::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)1.59.0 (const: 1.59.0) · #### pub const fn is\_power\_of\_two(self) -> bool Returns `true` if and only if `self == (1 << k)` for some `k`. On many architectures, this function can perform better than `is_power_of_two()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let eight = std::num::NonZeroU64::new(8).unwrap(); assert!(eight.is_power_of_two()); let ten = std::num::NonZeroU64::new(10).unwrap(); assert!(!ten.is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MIN: NonZeroU64 = Self::new(1).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, 1. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU64::MIN.get(), 1u64); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MAX: NonZeroU64 = Self::new(u64::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`u64::MAX`](../primitive.u64#associatedconstant.MAX "u64::MAX"). ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU64::MAX.get(), u64::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`u64::BITS`](../primitive.u64#associatedconstant.BITS "u64::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroU64::BITS, u64::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU64> for NonZeroU64 #### type Output = NonZeroU64 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU64) -> <NonZeroU64 as BitOr<NonZeroU64>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU64> for u64 #### type Output = NonZeroU64 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU64) -> <u64 as BitOr<NonZeroU64>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u64> for NonZeroU64 #### type Output = NonZeroU64 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: u64) -> <NonZeroU64 as BitOr<u64>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroU64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: u64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroU64 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU64> for u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: NonZeroU64) -> u64 This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic. #### type Output = u64 The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#425)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#425)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroU64 Converts `NonZeroU16` to `NonZeroU64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#428)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#428)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroU64 Converts `NonZeroU32` to `NonZeroU64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#457)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU64> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#457)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU64) -> NonZeroI128 Converts `NonZeroU64` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#430)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU64> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#430)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU64) -> NonZeroU128 Converts `NonZeroU64` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU64> for u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroU64) -> u64 Converts a `NonZeroU64` into an `u64` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#421)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#421)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU64 Converts `NonZeroU8` to `NonZeroU64` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroU64 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroU64, <NonZeroU64 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroU64) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroU64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroU64) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroU64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroU64) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU64> for u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: NonZeroU64) -> u64 This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #### type Output = u64 The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#490)1.46.0 · ### impl TryFrom<u64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#490)#### fn try\_from( value: u64) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<u64>>::Error> Attempts to convert `u64` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroU64 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroU64 ### impl Send for NonZeroU64 ### impl Sync for NonZeroU64 ### impl Unpin for NonZeroU64 ### impl UnwindSafe for NonZeroU64 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroU32 Struct std::num::NonZeroU32 =========================== ``` #[repr(transparent)]pub struct NonZeroU32(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroU32>` is the same size as `u32`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroU32>>(), size_of::<u32>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.28.0 · #### pub const unsafe fn new\_unchecked(n: u32) -> NonZeroU32 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: u32) -> Option<NonZeroU32> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> u32 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU32::new(u32::MAX).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU32::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_add(self, other: u32) -> Option<NonZeroU32> Adds an unsigned integer to a non-zero value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let one = NonZeroU32::new(1)?; let two = NonZeroU32::new(2)?; let max = NonZeroU32::new(u32::MAX)?; assert_eq!(Some(two), one.checked_add(1)); assert_eq!(None, max.checked_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_add(self, other: u32) -> NonZeroU32 Adds an unsigned integer to a non-zero value. Return [`u32::MAX`](../primitive.u32#associatedconstant.MAX "u32::MAX") on overflow. ##### Examples ``` let one = NonZeroU32::new(1)?; let two = NonZeroU32::new(2)?; let max = NonZeroU32::new(u32::MAX)?; assert_eq!(two, one.saturating_add(1)); assert_eq!(max, max.saturating_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const unsafe fn unchecked\_add(self, other: u32) -> NonZeroU32 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self + rhs > u32::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let one = NonZeroU32::new(1)?; let two = NonZeroU32::new(2)?; assert_eq!(two, unsafe { one.unchecked_add(1) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<NonZeroU32> Returns the smallest power of two greater than or equal to n. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if the next power of two is greater than the type’s maximum value. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU32::new(2)?; let three = NonZeroU32::new(3)?; let four = NonZeroU32::new(4)?; let max = NonZeroU32::new(u32::MAX)?; assert_eq!(Some(two), two.checked_next_power_of_two() ); assert_eq!(Some(four), three.checked_next_power_of_two() ); assert_eq!(None, max.checked_next_power_of_two() ); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog2(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 2 logarithm of the number, rounded down. This is the same operation as [`u32::ilog2`](../primitive.u32#method.ilog2 "u32::ilog2"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU32::new(7).unwrap().ilog2(), 2); assert_eq!(NonZeroU32::new(8).unwrap().ilog2(), 3); assert_eq!(NonZeroU32::new(9).unwrap().ilog2(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog10(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 10 logarithm of the number, rounded down. This is the same operation as [`u32::ilog10`](../primitive.u32#method.ilog10 "u32::ilog10"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU32::new(99).unwrap().ilog10(), 1); assert_eq!(NonZeroU32::new(100).unwrap().ilog10(), 2); assert_eq!(NonZeroU32::new(101).unwrap().ilog10(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroU32) -> Option<NonZeroU32> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU32::new(2)?; let four = NonZeroU32::new(4)?; let max = NonZeroU32::new(u32::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroU32) -> NonZeroU32 Multiplies two non-zero integers together. Return [`u32::MAX`](../primitive.u32#associatedconstant.MAX "u32::MAX") on overflow. ##### Examples ``` let two = NonZeroU32::new(2)?; let four = NonZeroU32::new(4)?; let max = NonZeroU32::new(u32::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroU32) -> NonZeroU32 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > u32::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroU32::new(2)?; let four = NonZeroU32::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroU32> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroU32::new(3)?; let twenty_seven = NonZeroU32::new(27)?; let half_max = NonZeroU32::new(u32::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroU32 Raise non-zero value to an integer power. Return [`u32::MAX`](../primitive.u32#associatedconstant.MAX "u32::MAX") on overflow. ##### Examples ``` let three = NonZeroU32::new(3)?; let twenty_seven = NonZeroU32::new(27)?; let max = NonZeroU32::new(u32::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)1.59.0 (const: 1.59.0) · #### pub const fn is\_power\_of\_two(self) -> bool Returns `true` if and only if `self == (1 << k)` for some `k`. On many architectures, this function can perform better than `is_power_of_two()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let eight = std::num::NonZeroU32::new(8).unwrap(); assert!(eight.is_power_of_two()); let ten = std::num::NonZeroU32::new(10).unwrap(); assert!(!ten.is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MIN: NonZeroU32 = Self::new(1).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, 1. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU32::MIN.get(), 1u32); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MAX: NonZeroU32 = Self::new(u32::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`u32::MAX`](../primitive.u32#associatedconstant.MAX "u32::MAX"). ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU32::MAX.get(), u32::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 32u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`u32::BITS`](../primitive.u32#associatedconstant.BITS "u32::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroU32::BITS, u32::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU32> for NonZeroU32 #### type Output = NonZeroU32 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU32) -> <NonZeroU32 as BitOr<NonZeroU32>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU32> for u32 #### type Output = NonZeroU32 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU32) -> <u32 as BitOr<NonZeroU32>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u32> for NonZeroU32 #### type Output = NonZeroU32 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: u32) -> <NonZeroU32 as BitOr<u32>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroU32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: u32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroU32 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU32> for u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: NonZeroU32) -> u32 This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic. #### type Output = u32 The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#424)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#424)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroU32 Converts `NonZeroU16` to `NonZeroU32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#456)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#456)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroI128 Converts `NonZeroU32` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#455)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#455)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroI64 Converts `NonZeroU32` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#429)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#429)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroU128 Converts `NonZeroU32` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#428)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#428)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU32) -> NonZeroU64 Converts `NonZeroU32` to `NonZeroU64` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU32> for u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroU32) -> u32 Converts a `NonZeroU32` into an `u32` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#420)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#420)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU32 Converts `NonZeroU8` to `NonZeroU32` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroU32 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroU32, <NonZeroU32 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroU32) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroU32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroU32) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroU32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroU32) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU32> for u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: NonZeroU32) -> u32 This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #### type Output = u32 The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#489)1.46.0 · ### impl TryFrom<u32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#489)#### fn try\_from( value: u32) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<u32>>::Error> Attempts to convert `u32` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroU32 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroU32 ### impl Send for NonZeroU32 ### impl Sync for NonZeroU32 ### impl Unpin for NonZeroU32 ### impl UnwindSafe for NonZeroU32 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroI8 Struct std::num::NonZeroI8 ========================== ``` #[repr(transparent)]pub struct NonZeroI8(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroI8>` is the same size as `i8`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroI8>>(), size_of::<i8>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const unsafe fn new\_unchecked(n: i8) -> NonZeroI8 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: i8) -> Option<NonZeroI8> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> i8 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI8::new(-1i8).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI8::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)### impl NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn abs(self) -> NonZeroI8 Computes the absolute value of self. See [`i8::abs`](../primitive.i8#method.abs "i8::abs") for documentation on overflow behaviour. ##### Example ``` let pos = NonZeroI8::new(1)?; let neg = NonZeroI8::new(-1)?; assert_eq!(pos, pos.abs()); assert_eq!(pos, neg.abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn checked\_abs(self) -> Option<NonZeroI8> Checked absolute value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if `self == i8::MIN`. The result cannot be zero. ##### Example ``` let pos = NonZeroI8::new(1)?; let neg = NonZeroI8::new(-1)?; let min = NonZeroI8::new(i8::MIN)?; assert_eq!(Some(pos), neg.checked_abs()); assert_eq!(None, min.checked_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn overflowing\_abs(self) -> (NonZeroI8, bool) Computes the absolute value of self, with overflow information, see [`i8::overflowing_abs`](../primitive.i8#method.overflowing_abs "i8::overflowing_abs"). ##### Example ``` let pos = NonZeroI8::new(1)?; let neg = NonZeroI8::new(-1)?; let min = NonZeroI8::new(i8::MIN)?; assert_eq!((pos, false), pos.overflowing_abs()); assert_eq!((pos, false), neg.overflowing_abs()); assert_eq!((min, true), min.overflowing_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_abs(self) -> NonZeroI8 Saturating absolute value, see [`i8::saturating_abs`](../primitive.i8#method.saturating_abs "i8::saturating_abs"). ##### Example ``` let pos = NonZeroI8::new(1)?; let neg = NonZeroI8::new(-1)?; let min = NonZeroI8::new(i8::MIN)?; let min_plus = NonZeroI8::new(i8::MIN + 1)?; let max = NonZeroI8::new(i8::MAX)?; assert_eq!(pos, pos.saturating_abs()); assert_eq!(pos, neg.saturating_abs()); assert_eq!(max, min.saturating_abs()); assert_eq!(max, min_plus.saturating_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn wrapping\_abs(self) -> NonZeroI8 Wrapping absolute value, see [`i8::wrapping_abs`](../primitive.i8#method.wrapping_abs "i8::wrapping_abs"). ##### Example ``` let pos = NonZeroI8::new(1)?; let neg = NonZeroI8::new(-1)?; let min = NonZeroI8::new(i8::MIN)?; let max = NonZeroI8::new(i8::MAX)?; assert_eq!(pos, pos.wrapping_abs()); assert_eq!(pos, neg.wrapping_abs()); assert_eq!(min, min.wrapping_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn unsigned\_abs(self) -> NonZeroU8 Computes the absolute value of self without any wrapping or panicking. ##### Example ``` let u_pos = NonZeroU8::new(1)?; let i_pos = NonZeroI8::new(1)?; let i_neg = NonZeroI8::new(-1)?; let i_min = NonZeroI8::new(i8::MIN)?; let u_max = NonZeroU8::new(u8::MAX / 2 + 1)?; assert_eq!(u_pos, i_pos.unsigned_abs()); assert_eq!(u_pos, i_neg.unsigned_abs()); assert_eq!(u_max, i_min.unsigned_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroI8) -> Option<NonZeroI8> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroI8::new(2)?; let four = NonZeroI8::new(4)?; let max = NonZeroI8::new(i8::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroI8) -> NonZeroI8 Multiplies two non-zero integers together. Return [`i8::MAX`](../primitive.i8#associatedconstant.MAX "i8::MAX") on overflow. ##### Examples ``` let two = NonZeroI8::new(2)?; let four = NonZeroI8::new(4)?; let max = NonZeroI8::new(i8::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroI8) -> NonZeroI8 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > i8::MAX`, or `self * rhs < i8::MIN`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroI8::new(2)?; let four = NonZeroI8::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroI8> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroI8::new(3)?; let twenty_seven = NonZeroI8::new(27)?; let half_max = NonZeroI8::new(i8::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroI8 Raise non-zero value to an integer power. Return [`i8::MIN`](../primitive.i8#associatedconstant.MIN "i8::MIN") or [`i8::MAX`](../primitive.i8#associatedconstant.MAX "i8::MAX") on overflow. ##### Examples ``` let three = NonZeroI8::new(3)?; let twenty_seven = NonZeroI8::new(27)?; let max = NonZeroI8::new(i8::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)### impl NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MIN: NonZeroI8 = Self::new(i8::MIN).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, equal to [`i8::MIN`](../primitive.i8#associatedconstant.MIN "i8::MIN"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI8::MIN.get(), i8::MIN); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MAX: NonZeroI8 = Self::new(i8::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`i8::MAX`](../primitive.i8#associatedconstant.MAX "i8::MAX"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI8::MAX.get(), i8::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 8u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`i8::BITS`](../primitive.i8#associatedconstant.BITS "i8::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroI8::BITS, i8::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI8> for NonZeroI8 #### type Output = NonZeroI8 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI8) -> <NonZeroI8 as BitOr<NonZeroI8>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI8> for i8 #### type Output = NonZeroI8 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI8) -> <i8 as BitOr<NonZeroI8>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i8> for NonZeroI8 #### type Output = NonZeroI8 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: i8) -> <NonZeroI8 as BitOr<i8>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroI8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: i8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroI8 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#436)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#436)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI128 Converts `NonZeroI8` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#433)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#433)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI16 Converts `NonZeroI8` to `NonZeroI16` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#434)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#434)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI32 Converts `NonZeroI8` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#435)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#435)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI64 Converts `NonZeroI8` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#437)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#437)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroIsize Converts `NonZeroI8` to `NonZeroIsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for i8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroI8) -> i8 Converts a `NonZeroI8` into an `i8` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroI8 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroI8, <NonZeroI8 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroI8) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroI8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroI8) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroI8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroI8) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU8) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU8>>::Error> Attempts to convert `NonZeroU8` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#493)1.46.0 · ### impl TryFrom<i8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#493)#### fn try\_from(value: i8) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<i8>>::Error> Attempts to convert `i8` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroI8 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroI8 ### impl Send for NonZeroI8 ### impl Sync for NonZeroI8 ### impl Unpin for NonZeroI8 ### impl UnwindSafe for NonZeroI8 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::ParseIntError Struct std::num::ParseIntError ============================== ``` pub struct ParseIntError { /* private fields */ } ``` An error which can be returned when parsing an integer. This error is used as the error type for the `from_str_radix()` functions on the primitive integer types, such as [`i8::from_str_radix`](../primitive.i8#method.from_str_radix "i8::from_str_radix"). Potential causes ---------------- Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespace in the string e.g., when it is obtained from the standard input. Using the [`str::trim()`](../primitive.str#method.trim "str::trim()") method ensures that no whitespace remains before parsing. Example ------- ``` if let Err(e) = i32::from_str_radix("a12", 10) { println!("Failed conversion to i32: {e}"); } ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/error.rs.html#118)### impl ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#122)1.55.0 · #### pub fn kind(&self) -> &IntErrorKind Outputs the detailed cause of parsing an integer failing. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl Clone for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)#### fn clone(&self) -> ParseIntError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl Debug for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#144)### impl Display for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#145)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#152)### impl Error for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#154)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)#### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl PartialEq<ParseIntError> for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)#### fn eq(&self, other: &ParseIntError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl Eq for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl StructuralEq for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl StructuralPartialEq for ParseIntError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for ParseIntError ### impl Send for ParseIntError ### impl Sync for ParseIntError ### impl Unpin for ParseIntError ### impl UnwindSafe for ParseIntError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::num::NonZeroI16 Struct std::num::NonZeroI16 =========================== ``` #[repr(transparent)]pub struct NonZeroI16(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroI16>` is the same size as `i16`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroI16>>(), size_of::<i16>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const unsafe fn new\_unchecked(n: i16) -> NonZeroI16 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: i16) -> Option<NonZeroI16> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> i16 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI16::new(-1i16).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroI16::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)### impl NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn abs(self) -> NonZeroI16 Computes the absolute value of self. See [`i16::abs`](../primitive.i16#method.abs "i16::abs") for documentation on overflow behaviour. ##### Example ``` let pos = NonZeroI16::new(1)?; let neg = NonZeroI16::new(-1)?; assert_eq!(pos, pos.abs()); assert_eq!(pos, neg.abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn checked\_abs(self) -> Option<NonZeroI16> Checked absolute value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if `self == i16::MIN`. The result cannot be zero. ##### Example ``` let pos = NonZeroI16::new(1)?; let neg = NonZeroI16::new(-1)?; let min = NonZeroI16::new(i16::MIN)?; assert_eq!(Some(pos), neg.checked_abs()); assert_eq!(None, min.checked_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn overflowing\_abs(self) -> (NonZeroI16, bool) Computes the absolute value of self, with overflow information, see [`i16::overflowing_abs`](../primitive.i16#method.overflowing_abs "i16::overflowing_abs"). ##### Example ``` let pos = NonZeroI16::new(1)?; let neg = NonZeroI16::new(-1)?; let min = NonZeroI16::new(i16::MIN)?; assert_eq!((pos, false), pos.overflowing_abs()); assert_eq!((pos, false), neg.overflowing_abs()); assert_eq!((min, true), min.overflowing_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_abs(self) -> NonZeroI16 Saturating absolute value, see [`i16::saturating_abs`](../primitive.i16#method.saturating_abs "i16::saturating_abs"). ##### Example ``` let pos = NonZeroI16::new(1)?; let neg = NonZeroI16::new(-1)?; let min = NonZeroI16::new(i16::MIN)?; let min_plus = NonZeroI16::new(i16::MIN + 1)?; let max = NonZeroI16::new(i16::MAX)?; assert_eq!(pos, pos.saturating_abs()); assert_eq!(pos, neg.saturating_abs()); assert_eq!(max, min.saturating_abs()); assert_eq!(max, min_plus.saturating_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn wrapping\_abs(self) -> NonZeroI16 Wrapping absolute value, see [`i16::wrapping_abs`](../primitive.i16#method.wrapping_abs "i16::wrapping_abs"). ##### Example ``` let pos = NonZeroI16::new(1)?; let neg = NonZeroI16::new(-1)?; let min = NonZeroI16::new(i16::MIN)?; let max = NonZeroI16::new(i16::MAX)?; assert_eq!(pos, pos.wrapping_abs()); assert_eq!(pos, neg.wrapping_abs()); assert_eq!(min, min.wrapping_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#729-736)1.64.0 (const: 1.64.0) · #### pub const fn unsigned\_abs(self) -> NonZeroU16 Computes the absolute value of self without any wrapping or panicking. ##### Example ``` let u_pos = NonZeroU16::new(1)?; let i_pos = NonZeroI16::new(1)?; let i_neg = NonZeroI16::new(-1)?; let i_min = NonZeroI16::new(i16::MIN)?; let u_max = NonZeroU16::new(u16::MAX / 2 + 1)?; assert_eq!(u_pos, i_pos.unsigned_abs()); assert_eq!(u_pos, i_neg.unsigned_abs()); assert_eq!(u_max, i_min.unsigned_abs()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroI16) -> Option<NonZeroI16> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroI16::new(2)?; let four = NonZeroI16::new(4)?; let max = NonZeroI16::new(i16::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroI16) -> NonZeroI16 Multiplies two non-zero integers together. Return [`i16::MAX`](../primitive.i16#associatedconstant.MAX "i16::MAX") on overflow. ##### Examples ``` let two = NonZeroI16::new(2)?; let four = NonZeroI16::new(4)?; let max = NonZeroI16::new(i16::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroI16) -> NonZeroI16 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > i16::MAX`, or `self * rhs < i16::MIN`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroI16::new(2)?; let four = NonZeroI16::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroI16> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroI16::new(3)?; let twenty_seven = NonZeroI16::new(27)?; let half_max = NonZeroI16::new(i16::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroI16 Raise non-zero value to an integer power. Return [`i16::MIN`](../primitive.i16#associatedconstant.MIN "i16::MIN") or [`i16::MAX`](../primitive.i16#associatedconstant.MAX "i16::MAX") on overflow. ##### Examples ``` let three = NonZeroI16::new(3)?; let twenty_seven = NonZeroI16::new(27)?; let max = NonZeroI16::new(i16::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)### impl NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MIN: NonZeroI16 = Self::new(i16::MIN).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, equal to [`i16::MIN`](../primitive.i16#associatedconstant.MIN "i16::MIN"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI16::MIN.get(), i16::MIN); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1089-1096)#### pub const MAX: NonZeroI16 = Self::new(i16::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`i16::MAX`](../primitive.i16#associatedconstant.MAX "i16::MAX"). Note: While most integer types are defined for every whole number between `MIN` and `MAX`, signed non-zero integers are a special case. They have a “gap” at 0. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroI16::MAX.get(), i16::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 16u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`i16::BITS`](../primitive.i16#associatedconstant.BITS "i16::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroI16::BITS, i16::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI16> for NonZeroI16 #### type Output = NonZeroI16 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI16) -> <NonZeroI16 as BitOr<NonZeroI16>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI16> for i16 #### type Output = NonZeroI16 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroI16) -> <i16 as BitOr<NonZeroI16>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i16> for NonZeroI16 #### type Output = NonZeroI16 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: i16) -> <NonZeroI16 as BitOr<i16>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroI16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: i16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroI16 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#440)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#440)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroI128 Converts `NonZeroI16` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#438)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#438)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroI32 Converts `NonZeroI16` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#439)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#439)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroI64 Converts `NonZeroI16` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#441)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#441)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI16) -> NonZeroIsize Converts `NonZeroI16` to `NonZeroIsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI16> for i16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroI16) -> i16 Converts a `NonZeroI16` into an `i16` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#433)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroI8> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#433)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroI8) -> NonZeroI16 Converts `NonZeroI8` to `NonZeroI16` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#447)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#447)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroI16 Converts `NonZeroU8` to `NonZeroI16` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroI16 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroI16, <NonZeroI16 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroI16) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroI16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroI16) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroI16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroI16) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#494)1.46.0 · ### impl TryFrom<i16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#494)#### fn try\_from( value: i16) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<i16>>::Error> Attempts to convert `i16` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroI16 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroI16 ### impl Send for NonZeroI16 ### impl Sync for NonZeroI16 ### impl Unpin for NonZeroI16 ### impl UnwindSafe for NonZeroI16 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::NonZeroUsize Struct std::num::NonZeroUsize ============================= ``` #[repr(transparent)]pub struct NonZeroUsize(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroUsize>` is the same size as `usize`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroUsize>>(), size_of::<usize>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.28.0 · #### pub const unsafe fn new\_unchecked(n: usize) -> NonZeroUsize Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: usize) -> Option<NonZeroUsize> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> usize Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroUsize::new(usize::MAX).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroUsize::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_add(self, other: usize) -> Option<NonZeroUsize> Adds an unsigned integer to a non-zero value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let one = NonZeroUsize::new(1)?; let two = NonZeroUsize::new(2)?; let max = NonZeroUsize::new(usize::MAX)?; assert_eq!(Some(two), one.checked_add(1)); assert_eq!(None, max.checked_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_add(self, other: usize) -> NonZeroUsize Adds an unsigned integer to a non-zero value. Return [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") on overflow. ##### Examples ``` let one = NonZeroUsize::new(1)?; let two = NonZeroUsize::new(2)?; let max = NonZeroUsize::new(usize::MAX)?; assert_eq!(two, one.saturating_add(1)); assert_eq!(max, max.saturating_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const unsafe fn unchecked\_add(self, other: usize) -> NonZeroUsize 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self + rhs > usize::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let one = NonZeroUsize::new(1)?; let two = NonZeroUsize::new(2)?; assert_eq!(two, unsafe { one.unchecked_add(1) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<NonZeroUsize> Returns the smallest power of two greater than or equal to n. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if the next power of two is greater than the type’s maximum value. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroUsize::new(2)?; let three = NonZeroUsize::new(3)?; let four = NonZeroUsize::new(4)?; let max = NonZeroUsize::new(usize::MAX)?; assert_eq!(Some(two), two.checked_next_power_of_two() ); assert_eq!(Some(four), three.checked_next_power_of_two() ); assert_eq!(None, max.checked_next_power_of_two() ); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog2(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 2 logarithm of the number, rounded down. This is the same operation as [`usize::ilog2`](../primitive.usize#method.ilog2 "usize::ilog2"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroUsize::new(7).unwrap().ilog2(), 2); assert_eq!(NonZeroUsize::new(8).unwrap().ilog2(), 3); assert_eq!(NonZeroUsize::new(9).unwrap().ilog2(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog10(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 10 logarithm of the number, rounded down. This is the same operation as [`usize::ilog10`](../primitive.usize#method.ilog10 "usize::ilog10"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroUsize::new(99).unwrap().ilog10(), 1); assert_eq!(NonZeroUsize::new(100).unwrap().ilog10(), 2); assert_eq!(NonZeroUsize::new(101).unwrap().ilog10(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroUsize) -> Option<NonZeroUsize> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroUsize::new(2)?; let four = NonZeroUsize::new(4)?; let max = NonZeroUsize::new(usize::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroUsize) -> NonZeroUsize Multiplies two non-zero integers together. Return [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") on overflow. ##### Examples ``` let two = NonZeroUsize::new(2)?; let four = NonZeroUsize::new(4)?; let max = NonZeroUsize::new(usize::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroUsize) -> NonZeroUsize 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > usize::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroUsize::new(2)?; let four = NonZeroUsize::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroUsize> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroUsize::new(3)?; let twenty_seven = NonZeroUsize::new(27)?; let half_max = NonZeroUsize::new(usize::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroUsize Raise non-zero value to an integer power. Return [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") on overflow. ##### Examples ``` let three = NonZeroUsize::new(3)?; let twenty_seven = NonZeroUsize::new(27)?; let max = NonZeroUsize::new(usize::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)1.59.0 (const: 1.59.0) · #### pub const fn is\_power\_of\_two(self) -> bool Returns `true` if and only if `self == (1 << k)` for some `k`. On many architectures, this function can perform better than `is_power_of_two()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let eight = std::num::NonZeroUsize::new(8).unwrap(); assert!(eight.is_power_of_two()); let ten = std::num::NonZeroUsize::new(10).unwrap(); assert!(!ten.is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MIN: NonZeroUsize = Self::new(1).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, 1. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroUsize::MIN.get(), 1usize); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MAX: NonZeroUsize = Self::new(usize::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX"). ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroUsize::MAX.get(), usize::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`usize::BITS`](../primitive.usize#associatedconstant.BITS "usize::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroUsize::BITS, usize::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroUsize> for NonZeroUsize #### type Output = NonZeroUsize The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor( self, rhs: NonZeroUsize) -> <NonZeroUsize as BitOr<NonZeroUsize>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroUsize> for usize #### type Output = NonZeroUsize The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroUsize) -> <usize as BitOr<NonZeroUsize>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<usize> for NonZeroUsize #### type Output = NonZeroUsize The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: usize) -> <NonZeroUsize as BitOr<usize>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroUsize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroUsize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<usize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: usize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroUsize Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroUsize> for usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: NonZeroUsize) -> usize This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic. #### type Output = usize The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#427)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#427)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroUsize Converts `NonZeroU16` to `NonZeroUsize` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#423)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#423)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroUsize Converts `NonZeroU8` to `NonZeroUsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroUsize> for usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroUsize) -> usize Converts a `NonZeroUsize` into an `usize` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroUsize #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroUsize, <NonZeroUsize as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroUsize) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroUsize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroUsize) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroUsize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroUsize) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroUsize> for usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: NonZeroUsize) -> usize This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #### type Output = usize The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#538)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#545)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI128, <NonZeroI128 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#543)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI32, <NonZeroI32 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#544)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI64, <NonZeroI64 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#537)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU128, <NonZeroU128 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU128`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#535)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU32, <NonZeroU32 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU32`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#536)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU64, <NonZeroU64 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU64`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#492)1.46.0 · ### impl TryFrom<usize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#492)#### fn try\_from( value: usize) -> Result<NonZeroUsize, <NonZeroUsize as TryFrom<usize>>::Error> Attempts to convert `usize` to `NonZeroUsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroUsize Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroUsize ### impl Send for NonZeroUsize ### impl Sync for NonZeroUsize ### impl Unpin for NonZeroUsize ### impl UnwindSafe for NonZeroUsize Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Enum std::num::FpCategory Enum std::num::FpCategory ========================= ``` pub enum FpCategory { Nan, Infinite, Zero, Subnormal, Normal, } ``` A classification of floating point numbers. This `enum` is used as the return type for [`f32::classify`](../primitive.f32#method.classify "f32::classify") and [`f64::classify`](../primitive.f64#method.classify "f64::classify"). See their documentation for more. Examples -------- ``` use std::num::FpCategory; let num = 12.4_f32; let inf = f32::INFINITY; let zero = 0f32; let sub: f32 = 1.1754942e-38; let nan = f32::NAN; assert_eq!(num.classify(), FpCategory::Normal); assert_eq!(inf.classify(), FpCategory::Infinite); assert_eq!(zero.classify(), FpCategory::Zero); assert_eq!(nan.classify(), FpCategory::Nan); assert_eq!(sub.classify(), FpCategory::Subnormal); ``` Variants -------- ### `Nan` NaN (not a number): this value results from calculations like `(-1.0).sqrt()`. See [the documentation for `f32`](../primitive.f32) for more information on the unusual properties of NaN. ### `Infinite` Positive or negative infinity, which often results from dividing a nonzero number by zero. ### `Zero` Positive or negative zero. See [the documentation for `f32`](../primitive.f32) for more information on the signedness of zeroes. ### `Subnormal` “Subnormal” or “denormal” floating point representation (less precise, relative to their magnitude, than [`Normal`](enum.fpcategory#variant.Normal)). Subnormal numbers are larger in magnitude than [`Zero`](enum.fpcategory#variant.Zero) but smaller in magnitude than all [`Normal`](enum.fpcategory#variant.Normal) numbers. ### `Normal` A regular floating point number, not any of the exceptional categories. The smallest positive normal numbers are [`f32::MIN_POSITIVE`](../primitive.f32#associatedconstant.MIN_POSITIVE "f32::MIN_POSITIVE") and [`f64::MIN_POSITIVE`](../primitive.f64#associatedconstant.MIN_POSITIVE "f64::MIN_POSITIVE"), and the largest positive normal numbers are [`f32::MAX`](../primitive.f32#associatedconstant.MAX "f32::MAX") and [`f64::MAX`](../primitive.f64#associatedconstant.MAX "f64::MAX"). (Unlike signed integers, floating point numbers are symmetric in their range, so negating any of these constants will produce their negative counterpart.) Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl Clone for FpCategory [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)#### fn clone(&self) -> FpCategory Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl Debug for FpCategory [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl PartialEq<FpCategory> for FpCategory [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)#### fn eq(&self, other: &FpCategory) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl Copy for FpCategory [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl Eq for FpCategory [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl StructuralEq for FpCategory [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl StructuralPartialEq for FpCategory Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for FpCategory ### impl Send for FpCategory ### impl Sync for FpCategory ### impl Unpin for FpCategory ### impl UnwindSafe for FpCategory Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::num::ParseFloatError Struct std::num::ParseFloatError ================================ ``` pub struct ParseFloatError { /* private fields */ } ``` An error which can be returned when parsing a float. This error is used as the error type for the [`FromStr`](../str/trait.fromstr "FromStr") implementation for [`f32`](../primitive.f32 "f32") and [`f64`](../primitive.f64 "f64"). Example ------- ``` use std::str::FromStr; if let Err(e) = f64::from_str("a.12") { println!("Failed conversion to f64: {e}"); } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl Clone for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)#### fn clone(&self) -> ParseFloatError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl Debug for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#202)### impl Display for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#203)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#65)### impl Error for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#67)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)#### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl PartialEq<ParseFloatError> for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)#### fn eq(&self, other: &ParseFloatError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl Eq for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl StructuralEq for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl StructuralPartialEq for ParseFloatError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for ParseFloatError ### impl Send for ParseFloatError ### impl Sync for ParseFloatError ### impl Unpin for ParseFloatError ### impl UnwindSafe for ParseFloatError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::num::NonZeroU16 Struct std::num::NonZeroU16 =========================== ``` #[repr(transparent)]pub struct NonZeroU16(_); ``` An integer that is known not to equal zero. This enables some memory layout optimization. For example, `Option<NonZeroU16>` is the same size as `u16`: ``` use std::mem::size_of; assert_eq!(size_of::<Option<core::num::NonZeroU16>>(), size_of::<u16>()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.28.0 · #### pub const unsafe fn new\_unchecked(n: u16) -> NonZeroU16 Creates a non-zero without checking whether the value is non-zero. This results in undefined behaviour if the value is zero. ##### Safety The value must not be zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.47.0 · #### pub const fn new(n: u16) -> Option<NonZeroU16> Creates a non-zero if the given value is not zero. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: 1.34.0 · #### pub const fn get(self) -> u16 Returns the value as a primitive type. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn leading\_zeros(self) -> u32 Returns the number of leading zeros in the binary representation of `self`. On many architectures, this function can perform better than `leading_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU16::new(u16::MAX).unwrap(); assert_eq!(n.leading_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#250-263)1.53.0 (const: 1.53.0) · #### pub const fn trailing\_zeros(self) -> u32 Returns the number of trailing zeros in the binary representation of `self`. On many architectures, this function can perform better than `trailing_zeros()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let n = std::num::NonZeroU16::new(0b0101000).unwrap(); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_add(self, other: u16) -> Option<NonZeroU16> Adds an unsigned integer to a non-zero value. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let one = NonZeroU16::new(1)?; let two = NonZeroU16::new(2)?; let max = NonZeroU16::new(u16::MAX)?; assert_eq!(Some(two), one.checked_add(1)); assert_eq!(None, max.checked_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_add(self, other: u16) -> NonZeroU16 Adds an unsigned integer to a non-zero value. Return [`u16::MAX`](../primitive.u16#associatedconstant.MAX "u16::MAX") on overflow. ##### Examples ``` let one = NonZeroU16::new(1)?; let two = NonZeroU16::new(2)?; let max = NonZeroU16::new(u16::MAX)?; assert_eq!(two, one.saturating_add(1)); assert_eq!(max, max.saturating_add(1)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const unsafe fn unchecked\_add(self, other: u16) -> NonZeroU16 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Adds an unsigned integer to a non-zero value, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self + rhs > u16::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let one = NonZeroU16::new(1)?; let two = NonZeroU16::new(2)?; assert_eq!(two, unsafe { one.unchecked_add(1) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)1.64.0 (const: 1.64.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<NonZeroU16> Returns the smallest power of two greater than or equal to n. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") if the next power of two is greater than the type’s maximum value. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU16::new(2)?; let three = NonZeroU16::new(3)?; let four = NonZeroU16::new(4)?; let max = NonZeroU16::new(u16::MAX)?; assert_eq!(Some(two), two.checked_next_power_of_two() ); assert_eq!(Some(four), three.checked_next_power_of_two() ); assert_eq!(None, max.checked_next_power_of_two() ); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog2(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 2 logarithm of the number, rounded down. This is the same operation as [`u16::ilog2`](../primitive.u16#method.ilog2 "u16::ilog2"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU16::new(7).unwrap().ilog2(), 2); assert_eq!(NonZeroU16::new(8).unwrap().ilog2(), 3); assert_eq!(NonZeroU16::new(9).unwrap().ilog2(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#504-511)#### pub const fn ilog10(self) -> u32 🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887)) Returns the base 10 logarithm of the number, rounded down. This is the same operation as [`u16::ilog10`](../primitive.u16#method.ilog10 "u16::ilog10"), except that it has no failure cases to worry about since this value can never be zero. ##### Examples ``` #![feature(int_log)] assert_eq!(NonZeroU16::new(99).unwrap().ilog10(), 1); assert_eq!(NonZeroU16::new(100).unwrap().ilog10(), 2); assert_eq!(NonZeroU16::new(101).unwrap().ilog10(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_mul(self, other: NonZeroU16) -> Option<NonZeroU16> Multiplies two non-zero integers together. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let two = NonZeroU16::new(2)?; let four = NonZeroU16::new(4)?; let max = NonZeroU16::new(u16::MAX)?; assert_eq!(Some(four), two.checked_mul(two)); assert_eq!(None, max.checked_mul(two)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_mul(self, other: NonZeroU16) -> NonZeroU16 Multiplies two non-zero integers together. Return [`u16::MAX`](../primitive.u16#associatedconstant.MAX "u16::MAX") on overflow. ##### Examples ``` let two = NonZeroU16::new(2)?; let four = NonZeroU16::new(4)?; let max = NonZeroU16::new(u16::MAX)?; assert_eq!(four, two.saturating_mul(two)); assert_eq!(max, four.saturating_mul(max)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)#### pub const unsafe fn unchecked\_mul(self, other: NonZeroU16) -> NonZeroU16 🔬This is a nightly-only experimental API. (`nonzero_ops` [#84186](https://github.com/rust-lang/rust/issues/84186)) Multiplies two non-zero integers together, assuming overflow cannot occur. Overflow is unchecked, and it is undefined behaviour to overflow *even if the result would wrap to a non-zero value*. The behaviour is undefined as soon as `self * rhs > u16::MAX`. ##### Examples ``` #![feature(nonzero_ops)] let two = NonZeroU16::new(2)?; let four = NonZeroU16::new(4)?; assert_eq!(four, unsafe { two.unchecked_mul(two) }); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn checked\_pow(self, other: u32) -> Option<NonZeroU16> Raises non-zero value to an integer power. Checks for overflow and returns [`None`](../option/enum.option#variant.None "None") on overflow. As a consequence, the result cannot wrap to zero. ##### Examples ``` let three = NonZeroU16::new(3)?; let twenty_seven = NonZeroU16::new(27)?; let half_max = NonZeroU16::new(u16::MAX / 2)?; assert_eq!(Some(twenty_seven), three.checked_pow(3)); assert_eq!(None, half_max.checked_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#942-955)1.64.0 (const: 1.64.0) · #### pub const fn saturating\_pow(self, other: u32) -> NonZeroU16 Raise non-zero value to an integer power. Return [`u16::MAX`](../primitive.u16#associatedconstant.MAX "u16::MAX") on overflow. ##### Examples ``` let three = NonZeroU16::new(3)?; let twenty_seven = NonZeroU16::new(27)?; let max = NonZeroU16::new(u16::MAX)?; assert_eq!(twenty_seven, three.saturating_pow(3)); assert_eq!(max, max.saturating_pow(3)); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#995)1.59.0 (const: 1.59.0) · #### pub const fn is\_power\_of\_two(self) -> bool Returns `true` if and only if `self == (1 << k)` for some `k`. On many architectures, this function can perform better than `is_power_of_two()` on the underlying integer type, as special handling of zero can be avoided. ##### Examples Basic usage: ``` let eight = std::num::NonZeroU16::new(8).unwrap(); assert!(eight.is_power_of_two()); let ten = std::num::NonZeroU16::new(10).unwrap(); assert!(!ten.is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MIN: NonZeroU16 = Self::new(1).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The smallest value that can be represented by this non-zero integer type, 1. ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU16::MIN.get(), 1u16); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1080-1087)#### pub const MAX: NonZeroU16 = Self::new(u16::MAX).unwrap() 🔬This is a nightly-only experimental API. (`nonzero_min_max` [#89065](https://github.com/rust-lang/rust/issues/89065)) The largest value that can be represented by this non-zero integer type, equal to [`u16::MAX`](../primitive.u16#associatedconstant.MAX "u16::MAX"). ##### Examples ``` #![feature(nonzero_min_max)] assert_eq!(NonZeroU16::MAX.get(), u16::MAX); ``` [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)### impl NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#1121-1134)#### pub const BITS: u32 = 16u32 🔬This is a nightly-only experimental API. (`nonzero_bits` [#94881](https://github.com/rust-lang/rust/issues/94881)) The size of this non-zero integer type in bits. This value is equal to [`u16::BITS`](../primitive.u16#associatedconstant.BITS "u16::BITS"). ##### Examples ``` #![feature(nonzero_bits)] assert_eq!(NonZeroU16::BITS, u16::BITS); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Binary for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU16> for NonZeroU16 #### type Output = NonZeroU16 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU16) -> <NonZeroU16 as BitOr<NonZeroU16>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU16> for u16 #### type Output = NonZeroU16 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: NonZeroU16) -> <u16 as BitOr<NonZeroU16>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u16> for NonZeroU16 #### type Output = NonZeroU16 The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor(self, rhs: u16) -> <NonZeroU16 as BitOr<u16>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: NonZeroU16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, rhs: u16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Clone for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn clone(&self) -> NonZeroU16 Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Debug for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Display for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU16> for u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div(self, other: NonZeroU16) -> u16 This operation rounds towards zero, truncating any fractional part of the exact result, and cannot panic. #### type Output = u16 The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#454)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#454)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroI128 Converts `NonZeroU16` to `NonZeroI128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#452)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#452)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroI32 Converts `NonZeroU16` to `NonZeroI32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#453)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#453)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroI64 Converts `NonZeroU16` to `NonZeroI64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#426)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#426)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroU128 Converts `NonZeroU16` to `NonZeroU128` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#424)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#424)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroU32 Converts `NonZeroU16` to `NonZeroU32` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#425)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#425)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroU64 Converts `NonZeroU16` to `NonZeroU64` losslessly. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#427)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#427)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU16) -> NonZeroUsize Converts `NonZeroU16` to `NonZeroUsize` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU16> for u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(nonzero: NonZeroU16) -> u16 Converts a `NonZeroU16` into an `u16` [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#419)1.41.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<NonZeroU8> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#419)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: NonZeroU8) -> NonZeroU16 Converts `NonZeroU8` to `NonZeroU16` losslessly. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)1.35.0 · ### impl FromStr for NonZeroU16 #### type Err = ParseIntError The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#191-192)#### fn from\_str(src: &str) -> Result<NonZeroU16, <NonZeroU16 as FromStr>::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Hash for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl LowerHex for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Octal for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Ord for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn cmp(&self, other: &NonZeroU16) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialEq<NonZeroU16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn eq(&self, other: &NonZeroU16) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl PartialOrd<NonZeroU16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn partial\_cmp(&self, other: &NonZeroU16) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU16> for u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem(self, other: NonZeroU16) -> u16 This operation satisfies `n % d == n - (n / d) * d`, and cannot panic. #### type Output = u16 The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI128> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI128) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI128>>::Error> Attempts to convert `NonZeroI128` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI16) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI16>>::Error> Attempts to convert `NonZeroI16` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI32> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI32) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI32>>::Error> Attempts to convert `NonZeroI32` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI64> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI64) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI64>>::Error> Attempts to convert `NonZeroI64` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroI8> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroI8) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroI8>>::Error> Attempts to convert `NonZeroI8` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroIsize> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroIsize) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroIsize>>::Error> Attempts to convert `NonZeroIsize` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroU128> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroU128) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroU128>>::Error> Attempts to convert `NonZeroU128` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#542)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroI16, <NonZeroI16 as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroI16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#541)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroI8, <NonZeroI8 as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroI8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#546)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroIsize, <NonZeroIsize as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroIsize`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)1.49.0 · ### impl TryFrom<NonZeroU16> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#533)#### fn try\_from( value: NonZeroU16) -> Result<NonZeroU8, <NonZeroU8 as TryFrom<NonZeroU16>>::Error> Attempts to convert `NonZeroU16` to `NonZeroU8`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroU32> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroU32) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroU32>>::Error> Attempts to convert `NonZeroU32` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroU64> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroU64) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroU64>>::Error> Attempts to convert `NonZeroU64` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)1.49.0 · ### impl TryFrom<NonZeroUsize> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#534)#### fn try\_from( value: NonZeroUsize) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<NonZeroUsize>>::Error> Attempts to convert `NonZeroUsize` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#488)1.46.0 · ### impl TryFrom<u16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/convert/num.rs.html#488)#### fn try\_from( value: u16) -> Result<NonZeroU16, <NonZeroU16 as TryFrom<u16>>::Error> Attempts to convert `u16` to `NonZeroU16`. #### type Error = TryFromIntError The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl UpperHex for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Copy for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl Eq for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralEq for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)### impl StructuralPartialEq for NonZeroU16 Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NonZeroU16 ### impl Send for NonZeroU16 ### impl Sync for NonZeroU16 ### impl Unpin for NonZeroU16 ### impl UnwindSafe for NonZeroU16 Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::num::Saturating Struct std::num::Saturating =========================== ``` #[repr(transparent)]pub struct Saturating<T>(pub T); ``` 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Provides intentionally-saturating arithmetic on `T`. Operations like `+` on `u32` values are intended to never overflow, and in some debug configurations overflow is detected and results in a panic. While most arithmetic falls into this category, some code explicitly expects and relies upon saturating arithmetic. Saturating arithmetic can be achieved either through methods like `saturating_add`, or through the `Saturating<T>` type, which says that all standard arithmetic operations on the underlying value are intended to have saturating semantics. The underlying value can be retrieved through the `.0` index of the `Saturating` tuple. Examples -------- ``` #![feature(saturating_int_impl)] use std::num::Saturating; let max = Saturating(u32::MAX); let one = Saturating(1u32); assert_eq!(u32::MAX, (max + one).0); ``` Tuple Fields ------------ `0: T` 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Implementations --------------- [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<usize> = Self(usize::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<usize>>::MIN, Saturating(usize::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<usize> = Self(usize::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<usize>>::MAX, Saturating(usize::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<usize>>::BITS, usize::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100usize); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0usize).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000usize); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<usize>) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ausize); if cfg!(target_endian = "big") { assert_eq!(<Saturating<usize>>::from_be(n), n) } else { assert_eq!(<Saturating<usize>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<usize>) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ausize); if cfg!(target_endian = "little") { assert_eq!(<Saturating<usize>>::from_le(n), n) } else { assert_eq!(<Saturating<usize>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ausize); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ausize); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<usize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3usize).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<u8> = Self(u8::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u8>>::MIN, Saturating(u8::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<u8> = Self(u8::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u8>>::MAX, Saturating(u8::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 8u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u8>>::BITS, u8::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100u8); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0u8).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000u8); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<u8>) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au8); if cfg!(target_endian = "big") { assert_eq!(<Saturating<u8>>::from_be(n), n) } else { assert_eq!(<Saturating<u8>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<u8>) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au8); if cfg!(target_endian = "little") { assert_eq!(<Saturating<u8>>::from_le(n), n) } else { assert_eq!(<Saturating<u8>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au8); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au8); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<u8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3u8).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<u16> = Self(u16::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u16>>::MIN, Saturating(u16::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<u16> = Self(u16::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u16>>::MAX, Saturating(u16::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 16u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u16>>::BITS, u16::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100u16); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0u16).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000u16); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<u16>) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au16); if cfg!(target_endian = "big") { assert_eq!(<Saturating<u16>>::from_be(n), n) } else { assert_eq!(<Saturating<u16>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<u16>) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au16); if cfg!(target_endian = "little") { assert_eq!(<Saturating<u16>>::from_le(n), n) } else { assert_eq!(<Saturating<u16>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au16); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au16); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<u16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3u16).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<u32> = Self(u32::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u32>>::MIN, Saturating(u32::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<u32> = Self(u32::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u32>>::MAX, Saturating(u32::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 32u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u32>>::BITS, u32::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100u32); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0u32).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000u32); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<u32>) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au32); if cfg!(target_endian = "big") { assert_eq!(<Saturating<u32>>::from_be(n), n) } else { assert_eq!(<Saturating<u32>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<u32>) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au32); if cfg!(target_endian = "little") { assert_eq!(<Saturating<u32>>::from_le(n), n) } else { assert_eq!(<Saturating<u32>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au32); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au32); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<u32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3u32).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<u64> = Self(u64::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u64>>::MIN, Saturating(u64::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<u64> = Self(u64::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u64>>::MAX, Saturating(u64::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u64>>::BITS, u64::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100u64); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0u64).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000u64); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<u64>) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au64); if cfg!(target_endian = "big") { assert_eq!(<Saturating<u64>>::from_be(n), n) } else { assert_eq!(<Saturating<u64>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<u64>) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au64); if cfg!(target_endian = "little") { assert_eq!(<Saturating<u64>>::from_le(n), n) } else { assert_eq!(<Saturating<u64>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au64); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au64); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<u64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3u64).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<u128> = Self(u128::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u128>>::MIN, Saturating(u128::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<u128> = Self(u128::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u128>>::MAX, Saturating(u128::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 128u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<u128>>::BITS, u128::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100u128); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0u128).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000u128); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<u128>) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au128); if cfg!(target_endian = "big") { assert_eq!(<Saturating<u128>>::from_be(n), n) } else { assert_eq!(<Saturating<u128>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<u128>) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au128); if cfg!(target_endian = "little") { assert_eq!(<Saturating<u128>>::from_le(n), n) } else { assert_eq!(<Saturating<u128>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au128); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Au128); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<u128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3u128).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<isize> = Self(isize::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<isize>>::MIN, Saturating(isize::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<isize> = Self(isize::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<isize>>::MAX, Saturating(isize::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<isize>>::BITS, isize::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100isize); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0isize).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000isize); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<isize>) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Aisize); if cfg!(target_endian = "big") { assert_eq!(<Saturating<isize>>::from_be(n), n) } else { assert_eq!(<Saturating<isize>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<isize>) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Aisize); if cfg!(target_endian = "little") { assert_eq!(<Saturating<isize>>::from_le(n), n) } else { assert_eq!(<Saturating<isize>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Aisize); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Aisize); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3isize).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<i8> = Self(i8::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i8>>::MIN, Saturating(i8::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<i8> = Self(i8::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i8>>::MAX, Saturating(i8::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 8u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i8>>::BITS, i8::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100i8); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0i8).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000i8); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<i8>) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai8); if cfg!(target_endian = "big") { assert_eq!(<Saturating<i8>>::from_be(n), n) } else { assert_eq!(<Saturating<i8>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<i8>) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai8); if cfg!(target_endian = "little") { assert_eq!(<Saturating<i8>>::from_le(n), n) } else { assert_eq!(<Saturating<i8>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai8); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai8); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<i16> = Self(i16::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i16>>::MIN, Saturating(i16::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<i16> = Self(i16::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i16>>::MAX, Saturating(i16::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 16u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i16>>::BITS, i16::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100i16); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0i16).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000i16); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<i16>) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai16); if cfg!(target_endian = "big") { assert_eq!(<Saturating<i16>>::from_be(n), n) } else { assert_eq!(<Saturating<i16>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<i16>) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai16); if cfg!(target_endian = "little") { assert_eq!(<Saturating<i16>>::from_le(n), n) } else { assert_eq!(<Saturating<i16>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai16); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai16); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i16).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<i32> = Self(i32::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i32>>::MIN, Saturating(i32::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<i32> = Self(i32::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i32>>::MAX, Saturating(i32::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 32u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i32>>::BITS, i32::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100i32); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0i32).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000i32); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<i32>) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai32); if cfg!(target_endian = "big") { assert_eq!(<Saturating<i32>>::from_be(n), n) } else { assert_eq!(<Saturating<i32>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<i32>) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai32); if cfg!(target_endian = "little") { assert_eq!(<Saturating<i32>>::from_le(n), n) } else { assert_eq!(<Saturating<i32>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai32); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai32); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i32).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<i64> = Self(i64::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i64>>::MIN, Saturating(i64::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<i64> = Self(i64::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i64>>::MAX, Saturating(i64::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 64u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i64>>::BITS, i64::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100i64); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0i64).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000i64); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<i64>) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai64); if cfg!(target_endian = "big") { assert_eq!(<Saturating<i64>>::from_be(n), n) } else { assert_eq!(<Saturating<i64>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<i64>) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai64); if cfg!(target_endian = "little") { assert_eq!(<Saturating<i64>>::from_le(n), n) } else { assert_eq!(<Saturating<i64>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai64); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai64); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i64).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)### impl Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MIN: Saturating<i128> = Self(i128::MIN) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the smallest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i128>>::MIN, Saturating(i128::MIN)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const MAX: Saturating<i128> = Self(i128::MAX) 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the largest value that can be represented by this integer type. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i128>>::MAX, Saturating(i128::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const BITS: u32 = 128u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the size of this integer type in bits. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(<Saturating<i128>>::BITS, i128::BITS); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_ones(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of ones in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b01001100i128); assert_eq!(n.count_ones(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn count\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(!0i128).count_zeros(), 0); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn trailing\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of trailing zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0101000i128); assert_eq!(n.trailing_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_left(self, n: u32) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the left by a specified amount, `n`, saturating the truncated bits to the end of the resulting integer. Please note this isn’t the same operation as the `<<` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0x76543210FEDCBA99); assert_eq!(n.rotate_left(32), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn rotate\_right(self, n: u32) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Shifts the bits to the right by a specified amount, `n`, saturating the truncated bits to the beginning of the resulting integer. Please note this isn’t the same operation as the `>>` shifting operator! ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i64> = Saturating(0x0123456789ABCDEF); let m: Saturating<i64> = Saturating(-0xFEDCBA987654322); assert_eq!(n.rotate_right(4), m); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn swap\_bytes(self) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the byte order of the integer. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n: Saturating<i16> = Saturating(0b0000000_01010101); assert_eq!(n, Saturating(85)); let m = n.swap_bytes(); assert_eq!(m, Saturating(0b01010101_00000000)); assert_eq!(m, Saturating(21760)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)const: [unstable](https://github.com/rust-lang/rust/issues/87920 "Tracking issue for saturating_int_impl") · #### pub fn reverse\_bits(self) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Reverses the bit pattern of the integer. ##### Examples Please note that this example is shared between integer types. Which explains why `i16` is used here. Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0b0000000_01010101i16); assert_eq!(n, Saturating(85)); let m = n.reverse_bits(); assert_eq!(m.0 as u16, 0b10101010_00000000); assert_eq!(m, Saturating(-22016)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_be(x: Saturating<i128>) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from big endian to the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai128); if cfg!(target_endian = "big") { assert_eq!(<Saturating<i128>>::from_be(n), n) } else { assert_eq!(<Saturating<i128>>::from_be(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn from\_le(x: Saturating<i128>) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts an integer from little endian to the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai128); if cfg!(target_endian = "little") { assert_eq!(<Saturating<i128>>::from_le(n), n) } else { assert_eq!(<Saturating<i128>>::from_le(n), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_be(self) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to big endian from the target’s endianness. On big endian this is a no-op. On little endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai128); if cfg!(target_endian = "big") { assert_eq!(n.to_be(), n) } else { assert_eq!(n.to_be(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub const fn to\_le(self) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Converts `self` to little endian from the target’s endianness. On little endian this is a no-op. On big endian the bytes are swapped. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(0x1Ai128); if cfg!(target_endian = "little") { assert_eq!(n.to_le(), n) } else { assert_eq!(n.to_le(), n.swap_bytes()) } ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#858)#### pub fn pow(self, exp: u32) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Raises self to the power of `exp`, using exponentiation by squaring. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i128).pow(4), Saturating(81)); ``` Results that are too large are saturated: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(3i8).pow(5), Saturating(127)); assert_eq!(Saturating(3i8).pow(6), Saturating(127)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(isize::MAX >> 2); assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn abs(self) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(100isize).abs(), Saturating(100)); assert_eq!(Saturating(-100isize).abs(), Saturating(100)); assert_eq!(Saturating(isize::MIN).abs(), Saturating((isize::MIN + 1).abs())); assert_eq!(Saturating(isize::MIN).abs(), Saturating(isize::MIN.saturating_abs())); assert_eq!(Saturating(isize::MIN).abs(), Saturating(isize::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn signum(self) -> Saturating<isize> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(10isize).signum(), Saturating(1)); assert_eq!(Saturating(0isize).signum(), Saturating(0)); assert_eq!(Saturating(-10isize).signum(), Saturating(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(10isize).is_positive()); assert!(!Saturating(-10isize).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(-10isize).is_negative()); assert!(!Saturating(10isize).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(i8::MAX >> 2); assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn abs(self) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(100i8).abs(), Saturating(100)); assert_eq!(Saturating(-100i8).abs(), Saturating(100)); assert_eq!(Saturating(i8::MIN).abs(), Saturating((i8::MIN + 1).abs())); assert_eq!(Saturating(i8::MIN).abs(), Saturating(i8::MIN.saturating_abs())); assert_eq!(Saturating(i8::MIN).abs(), Saturating(i8::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn signum(self) -> Saturating<i8> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(10i8).signum(), Saturating(1)); assert_eq!(Saturating(0i8).signum(), Saturating(0)); assert_eq!(Saturating(-10i8).signum(), Saturating(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(10i8).is_positive()); assert!(!Saturating(-10i8).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(-10i8).is_negative()); assert!(!Saturating(10i8).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(i16::MAX >> 2); assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn abs(self) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(100i16).abs(), Saturating(100)); assert_eq!(Saturating(-100i16).abs(), Saturating(100)); assert_eq!(Saturating(i16::MIN).abs(), Saturating((i16::MIN + 1).abs())); assert_eq!(Saturating(i16::MIN).abs(), Saturating(i16::MIN.saturating_abs())); assert_eq!(Saturating(i16::MIN).abs(), Saturating(i16::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn signum(self) -> Saturating<i16> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(10i16).signum(), Saturating(1)); assert_eq!(Saturating(0i16).signum(), Saturating(0)); assert_eq!(Saturating(-10i16).signum(), Saturating(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(10i16).is_positive()); assert!(!Saturating(-10i16).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(-10i16).is_negative()); assert!(!Saturating(10i16).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(i32::MAX >> 2); assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn abs(self) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(100i32).abs(), Saturating(100)); assert_eq!(Saturating(-100i32).abs(), Saturating(100)); assert_eq!(Saturating(i32::MIN).abs(), Saturating((i32::MIN + 1).abs())); assert_eq!(Saturating(i32::MIN).abs(), Saturating(i32::MIN.saturating_abs())); assert_eq!(Saturating(i32::MIN).abs(), Saturating(i32::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn signum(self) -> Saturating<i32> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(10i32).signum(), Saturating(1)); assert_eq!(Saturating(0i32).signum(), Saturating(0)); assert_eq!(Saturating(-10i32).signum(), Saturating(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(10i32).is_positive()); assert!(!Saturating(-10i32).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(-10i32).is_negative()); assert!(!Saturating(10i32).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(i64::MAX >> 2); assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn abs(self) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(100i64).abs(), Saturating(100)); assert_eq!(Saturating(-100i64).abs(), Saturating(100)); assert_eq!(Saturating(i64::MIN).abs(), Saturating((i64::MIN + 1).abs())); assert_eq!(Saturating(i64::MIN).abs(), Saturating(i64::MIN.saturating_abs())); assert_eq!(Saturating(i64::MIN).abs(), Saturating(i64::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn signum(self) -> Saturating<i64> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(10i64).signum(), Saturating(1)); assert_eq!(Saturating(0i64).signum(), Saturating(0)); assert_eq!(Saturating(-10i64).signum(), Saturating(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(10i64).is_positive()); assert!(!Saturating(-10i64).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(-10i64).is_negative()); assert!(!Saturating(10i64).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(i128::MAX >> 2); assert_eq!(n.leading_zeros(), 3); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn abs(self) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(100i128).abs(), Saturating(100)); assert_eq!(Saturating(-100i128).abs(), Saturating(100)); assert_eq!(Saturating(i128::MIN).abs(), Saturating((i128::MIN + 1).abs())); assert_eq!(Saturating(i128::MIN).abs(), Saturating(i128::MIN.saturating_abs())); assert_eq!(Saturating(i128::MIN).abs(), Saturating(i128::MAX)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub fn signum(self) -> Saturating<i128> 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns a number representing sign of `self`. * `0` if the number is zero * `1` if the number is positive * `-1` if the number is negative ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(10i128).signum(), Saturating(1)); assert_eq!(Saturating(0i128).signum(), Saturating(0)); assert_eq!(Saturating(-10i128).signum(), Saturating(-1)); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_positive(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is positive and `false` if the number is zero or negative. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(10i128).is_positive()); assert!(!Saturating(-10i128).is_positive()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### pub const fn is\_negative(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if `self` is negative and `false` if the number is zero or positive. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(-10i128).is_negative()); assert!(!Saturating(10i128).is_negative()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)### impl Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(usize::MAX >> 2); assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(16usize).is_power_of_two()); assert!(!Saturating(10usize).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)### impl Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(u8::MAX >> 2); assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(16u8).is_power_of_two()); assert!(!Saturating(10u8).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)### impl Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(u16::MAX >> 2); assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(16u16).is_power_of_two()); assert!(!Saturating(10u16).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)### impl Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(u32::MAX >> 2); assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(16u32).is_power_of_two()); assert!(!Saturating(10u32).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)### impl Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(u64::MAX >> 2); assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(16u64).is_power_of_two()); assert!(!Saturating(10u64).is_power_of_two()); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)### impl Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub const fn leading\_zeros(self) -> u32 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns the number of leading zeros in the binary representation of `self`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; let n = Saturating(u128::MAX >> 2); assert_eq!(n.leading_zeros(), 2); ``` [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#1043)#### pub fn is\_power\_of\_two(self) -> bool 🔬This is a nightly-only experimental API. (`saturating_int_impl` [#87920](https://github.com/rust-lang/rust/issues/87920)) Returns `true` if and only if `self == 2^k` for some `k`. ##### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert!(Saturating(16u128).is_power_of_two()); assert!(!Saturating(10u128).is_power_of_two()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i128>) -> <Saturating<i128> as Add<Saturating<i128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i128>) -> <Saturating<i128> as Add<Saturating<i128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i16>) -> <Saturating<i16> as Add<Saturating<i16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i16>) -> <Saturating<i16> as Add<Saturating<i16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i32>) -> <Saturating<i32> as Add<Saturating<i32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i32>) -> <Saturating<i32> as Add<Saturating<i32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i64>) -> <Saturating<i64> as Add<Saturating<i64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i64>) -> <Saturating<i64> as Add<Saturating<i64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i8>) -> <Saturating<i8> as Add<Saturating<i8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<i8>) -> <Saturating<i8> as Add<Saturating<i8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<isize>) -> <Saturating<isize> as Add<Saturating<isize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<isize>) -> <Saturating<isize> as Add<Saturating<isize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u128>) -> <Saturating<u128> as Add<Saturating<u128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u128>) -> <Saturating<u128> as Add<Saturating<u128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u16>) -> <Saturating<u16> as Add<Saturating<u16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u16>) -> <Saturating<u16> as Add<Saturating<u16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u32>) -> <Saturating<u32> as Add<Saturating<u32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u32>) -> <Saturating<u32> as Add<Saturating<u32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u64>) -> <Saturating<u64> as Add<Saturating<u64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u64>) -> <Saturating<u64> as Add<Saturating<u64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u8>) -> <Saturating<u8> as Add<Saturating<u8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<u8>) -> <Saturating<u8> as Add<Saturating<u8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<usize>) -> <Saturating<usize> as Add<Saturating<usize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: &Saturating<usize>) -> <Saturating<usize> as Add<Saturating<usize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<i128>) -> <Saturating<i128> as Add<Saturating<i128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<i128>) -> Saturating<i128> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<i16>) -> <Saturating<i16> as Add<Saturating<i16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<i16>) -> Saturating<i16> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<i32>) -> <Saturating<i32> as Add<Saturating<i32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<i32>) -> Saturating<i32> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<i64>) -> <Saturating<i64> as Add<Saturating<i64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<i64>) -> Saturating<i64> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<i8>) -> <Saturating<i8> as Add<Saturating<i8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<i8>) -> Saturating<i8> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<isize>) -> <Saturating<isize> as Add<Saturating<isize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<isize>) -> Saturating<isize> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<u128>) -> <Saturating<u128> as Add<Saturating<u128>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<u128>) -> Saturating<u128> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<u16>) -> <Saturating<u16> as Add<Saturating<u16>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<u16>) -> Saturating<u16> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<u32>) -> <Saturating<u32> as Add<Saturating<u32>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<u32>) -> Saturating<u32> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<u64>) -> <Saturating<u64> as Add<Saturating<u64>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<u64>) -> Saturating<u64> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<u8>) -> <Saturating<u8> as Add<Saturating<u8>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<u8>) -> Saturating<u8> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add( self, other: Saturating<usize>) -> <Saturating<usize> as Add<Saturating<usize>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add(self, other: Saturating<usize>) -> Saturating<usize> Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<i128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<i16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<i32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<i64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<i8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<isize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<u128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<u16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<u32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<u64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<u8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &Saturating<usize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &i128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &i16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &i32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &i64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &i8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &isize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &u128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &u16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &u32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &u64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &u8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: &usize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<i128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<i16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<i32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<i64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<i8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<isize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<u128>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<u16>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<u32>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<u64>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<u8>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: Saturating<usize>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: i128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: i16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: i32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: i64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: i8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: isize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: u128) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: u16) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: u32) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: u64) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: u8) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn add\_assign(&mut self, other: usize) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#55)### impl<T> Binary for Saturating<T>where T: [Binary](../fmt/trait.binary "trait std::fmt::Binary"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#56)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i128>) -> <Saturating<i128> as BitAnd<Saturating<i128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i128>) -> <Saturating<i128> as BitAnd<Saturating<i128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i16>) -> <Saturating<i16> as BitAnd<Saturating<i16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i16>) -> <Saturating<i16> as BitAnd<Saturating<i16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i32>) -> <Saturating<i32> as BitAnd<Saturating<i32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i32>) -> <Saturating<i32> as BitAnd<Saturating<i32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i64>) -> <Saturating<i64> as BitAnd<Saturating<i64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i64>) -> <Saturating<i64> as BitAnd<Saturating<i64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i8>) -> <Saturating<i8> as BitAnd<Saturating<i8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<i8>) -> <Saturating<i8> as BitAnd<Saturating<i8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<isize>) -> <Saturating<isize> as BitAnd<Saturating<isize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<isize>) -> <Saturating<isize> as BitAnd<Saturating<isize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u128>) -> <Saturating<u128> as BitAnd<Saturating<u128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u128>) -> <Saturating<u128> as BitAnd<Saturating<u128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u16>) -> <Saturating<u16> as BitAnd<Saturating<u16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u16>) -> <Saturating<u16> as BitAnd<Saturating<u16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u32>) -> <Saturating<u32> as BitAnd<Saturating<u32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u32>) -> <Saturating<u32> as BitAnd<Saturating<u32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u64>) -> <Saturating<u64> as BitAnd<Saturating<u64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u64>) -> <Saturating<u64> as BitAnd<Saturating<u64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u8>) -> <Saturating<u8> as BitAnd<Saturating<u8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<u8>) -> <Saturating<u8> as BitAnd<Saturating<u8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<usize>) -> <Saturating<usize> as BitAnd<Saturating<usize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: &Saturating<usize>) -> <Saturating<usize> as BitAnd<Saturating<usize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<i128>) -> <Saturating<i128> as BitAnd<Saturating<i128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<i128>) -> Saturating<i128> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<i16>) -> <Saturating<i16> as BitAnd<Saturating<i16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<i16>) -> Saturating<i16> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<i32>) -> <Saturating<i32> as BitAnd<Saturating<i32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<i32>) -> Saturating<i32> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<i64>) -> <Saturating<i64> as BitAnd<Saturating<i64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<i64>) -> Saturating<i64> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<i8>) -> <Saturating<i8> as BitAnd<Saturating<i8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<i8>) -> Saturating<i8> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<isize>) -> <Saturating<isize> as BitAnd<Saturating<isize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<isize>) -> Saturating<isize> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<u128>) -> <Saturating<u128> as BitAnd<Saturating<u128>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<u128>) -> Saturating<u128> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<u16>) -> <Saturating<u16> as BitAnd<Saturating<u16>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<u16>) -> Saturating<u16> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<u32>) -> <Saturating<u32> as BitAnd<Saturating<u32>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<u32>) -> Saturating<u32> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<u64>) -> <Saturating<u64> as BitAnd<Saturating<u64>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<u64>) -> Saturating<u64> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<u8>) -> <Saturating<u8> as BitAnd<Saturating<u8>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<u8>) -> Saturating<u8> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand( self, other: Saturating<usize>) -> <Saturating<usize> as BitAnd<Saturating<usize>>>::Output Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `&` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand(self, other: Saturating<usize>) -> Saturating<usize> Performs the `&` operation. [Read more](../ops/trait.bitand#tymethod.bitand) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<i128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<i16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<i32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<i64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<i8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<isize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<u128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<u16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<u32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<u64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<u8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &Saturating<usize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &i128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &i16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &i32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &i64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &i8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &isize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &u128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &u16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &u32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &u64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &u8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: &usize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<i128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<i16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<i32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<i64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<i8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<isize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<u128>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<u16>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<u32>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<u64>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<u8>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: Saturating<usize>) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: i128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: i16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: i32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: i64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: i8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: isize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: u128) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: u16) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: u32) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: u64) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: u8) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitand\_assign(&mut self, other: usize) Performs the `&=` operation. [Read more](../ops/trait.bitandassign#tymethod.bitand_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i128>) -> <Saturating<i128> as BitOr<Saturating<i128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i128>) -> <Saturating<i128> as BitOr<Saturating<i128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i16>) -> <Saturating<i16> as BitOr<Saturating<i16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i16>) -> <Saturating<i16> as BitOr<Saturating<i16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i32>) -> <Saturating<i32> as BitOr<Saturating<i32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i32>) -> <Saturating<i32> as BitOr<Saturating<i32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i64>) -> <Saturating<i64> as BitOr<Saturating<i64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i64>) -> <Saturating<i64> as BitOr<Saturating<i64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i8>) -> <Saturating<i8> as BitOr<Saturating<i8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<i8>) -> <Saturating<i8> as BitOr<Saturating<i8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<isize>) -> <Saturating<isize> as BitOr<Saturating<isize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<isize>) -> <Saturating<isize> as BitOr<Saturating<isize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u128>) -> <Saturating<u128> as BitOr<Saturating<u128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u128>) -> <Saturating<u128> as BitOr<Saturating<u128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u16>) -> <Saturating<u16> as BitOr<Saturating<u16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u16>) -> <Saturating<u16> as BitOr<Saturating<u16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u32>) -> <Saturating<u32> as BitOr<Saturating<u32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u32>) -> <Saturating<u32> as BitOr<Saturating<u32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u64>) -> <Saturating<u64> as BitOr<Saturating<u64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u64>) -> <Saturating<u64> as BitOr<Saturating<u64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u8>) -> <Saturating<u8> as BitOr<Saturating<u8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<u8>) -> <Saturating<u8> as BitOr<Saturating<u8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<usize>) -> <Saturating<usize> as BitOr<Saturating<usize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: &Saturating<usize>) -> <Saturating<usize> as BitOr<Saturating<usize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<i128>) -> <Saturating<i128> as BitOr<Saturating<i128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<i128>) -> Saturating<i128> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<i16>) -> <Saturating<i16> as BitOr<Saturating<i16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<i16>) -> Saturating<i16> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<i32>) -> <Saturating<i32> as BitOr<Saturating<i32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<i32>) -> Saturating<i32> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<i64>) -> <Saturating<i64> as BitOr<Saturating<i64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<i64>) -> Saturating<i64> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<i8>) -> <Saturating<i8> as BitOr<Saturating<i8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<i8>) -> Saturating<i8> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<isize>) -> <Saturating<isize> as BitOr<Saturating<isize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<isize>) -> Saturating<isize> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<u128>) -> <Saturating<u128> as BitOr<Saturating<u128>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<u128>) -> Saturating<u128> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<u16>) -> <Saturating<u16> as BitOr<Saturating<u16>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<u16>) -> Saturating<u16> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<u32>) -> <Saturating<u32> as BitOr<Saturating<u32>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<u32>) -> Saturating<u32> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<u64>) -> <Saturating<u64> as BitOr<Saturating<u64>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<u64>) -> Saturating<u64> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<u8>) -> <Saturating<u8> as BitOr<Saturating<u8>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<u8>) -> Saturating<u8> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor( self, other: Saturating<usize>) -> <Saturating<usize> as BitOr<Saturating<usize>>>::Output Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `|` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor(self, other: Saturating<usize>) -> Saturating<usize> Performs the `|` operation. [Read more](../ops/trait.bitor#tymethod.bitor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<i128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<i16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<i32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<i64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<i8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<isize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<u128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<u16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<u32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<u64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<u8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &Saturating<usize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &i128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &i16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &i32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &i64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &i8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &isize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &u128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &u16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &u32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &u64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &u8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: &usize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<i128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<i16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<i32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<i64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<i8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<isize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<u128>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<u16>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<u32>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<u64>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<u8>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: Saturating<usize>) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: i128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: i16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: i32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: i64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: i8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: isize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: u128) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: u16) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: u32) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: u64) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: u8) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitor\_assign(&mut self, other: usize) Performs the `|=` operation. [Read more](../ops/trait.bitorassign#tymethod.bitor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i128>) -> <Saturating<i128> as BitXor<Saturating<i128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i128>) -> <Saturating<i128> as BitXor<Saturating<i128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i16>) -> <Saturating<i16> as BitXor<Saturating<i16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i16>) -> <Saturating<i16> as BitXor<Saturating<i16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i32>) -> <Saturating<i32> as BitXor<Saturating<i32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i32>) -> <Saturating<i32> as BitXor<Saturating<i32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i64>) -> <Saturating<i64> as BitXor<Saturating<i64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i64>) -> <Saturating<i64> as BitXor<Saturating<i64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i8>) -> <Saturating<i8> as BitXor<Saturating<i8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<i8>) -> <Saturating<i8> as BitXor<Saturating<i8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<isize>) -> <Saturating<isize> as BitXor<Saturating<isize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<isize>) -> <Saturating<isize> as BitXor<Saturating<isize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u128>) -> <Saturating<u128> as BitXor<Saturating<u128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u128>) -> <Saturating<u128> as BitXor<Saturating<u128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u16>) -> <Saturating<u16> as BitXor<Saturating<u16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u16>) -> <Saturating<u16> as BitXor<Saturating<u16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u32>) -> <Saturating<u32> as BitXor<Saturating<u32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u32>) -> <Saturating<u32> as BitXor<Saturating<u32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u64>) -> <Saturating<u64> as BitXor<Saturating<u64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u64>) -> <Saturating<u64> as BitXor<Saturating<u64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u8>) -> <Saturating<u8> as BitXor<Saturating<u8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<u8>) -> <Saturating<u8> as BitXor<Saturating<u8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<usize>) -> <Saturating<usize> as BitXor<Saturating<usize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: &Saturating<usize>) -> <Saturating<usize> as BitXor<Saturating<usize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<i128>) -> <Saturating<i128> as BitXor<Saturating<i128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<i128>) -> Saturating<i128> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<i16>) -> <Saturating<i16> as BitXor<Saturating<i16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<i16>) -> Saturating<i16> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<i32>) -> <Saturating<i32> as BitXor<Saturating<i32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<i32>) -> Saturating<i32> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<i64>) -> <Saturating<i64> as BitXor<Saturating<i64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<i64>) -> Saturating<i64> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<i8>) -> <Saturating<i8> as BitXor<Saturating<i8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<i8>) -> Saturating<i8> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<isize>) -> <Saturating<isize> as BitXor<Saturating<isize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<isize>) -> Saturating<isize> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<u128>) -> <Saturating<u128> as BitXor<Saturating<u128>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<u128>) -> Saturating<u128> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<u16>) -> <Saturating<u16> as BitXor<Saturating<u16>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<u16>) -> Saturating<u16> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<u32>) -> <Saturating<u32> as BitXor<Saturating<u32>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<u32>) -> Saturating<u32> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<u64>) -> <Saturating<u64> as BitXor<Saturating<u64>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<u64>) -> Saturating<u64> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<u8>) -> <Saturating<u8> as BitXor<Saturating<u8>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<u8>) -> Saturating<u8> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor( self, other: Saturating<usize>) -> <Saturating<usize> as BitXor<Saturating<usize>>>::Output Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `^` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor(self, other: Saturating<usize>) -> Saturating<usize> Performs the `^` operation. [Read more](../ops/trait.bitxor#tymethod.bitxor) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<i128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<i16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<i32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<i64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<i8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<isize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<u128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<u16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<u32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<u64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<u8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &Saturating<usize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &i128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &i16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &i32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &i64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &i8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &isize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &u128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &u16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &u32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &u64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &u8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: &usize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<i128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<i16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<i32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<i64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<i8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<isize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<u128>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<u16>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<u32>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<u64>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<u8>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: Saturating<usize>) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: i128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: i16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: i32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: i64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: i8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: isize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: u128) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: u16) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: u32) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: u64) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: u8) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn bitxor\_assign(&mut self, other: usize) Performs the `^=` operation. [Read more](../ops/trait.bitxorassign#tymethod.bitxor_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Clone for Saturating<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)#### fn clone(&self) -> Saturating<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#41)### impl<T> Debug for Saturating<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#42)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Default for Saturating<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)#### fn default() -> Saturating<T> Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#48)### impl<T> Display for Saturating<T>where T: [Display](../fmt/trait.display "trait std::fmt::Display"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#49)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i128>) -> <Saturating<i128> as Div<Saturating<i128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i128>) -> <Saturating<i128> as Div<Saturating<i128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i16>) -> <Saturating<i16> as Div<Saturating<i16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i16>) -> <Saturating<i16> as Div<Saturating<i16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i32>) -> <Saturating<i32> as Div<Saturating<i32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i32>) -> <Saturating<i32> as Div<Saturating<i32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i64>) -> <Saturating<i64> as Div<Saturating<i64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i64>) -> <Saturating<i64> as Div<Saturating<i64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i8>) -> <Saturating<i8> as Div<Saturating<i8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<i8>) -> <Saturating<i8> as Div<Saturating<i8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<isize>) -> <Saturating<isize> as Div<Saturating<isize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<isize>) -> <Saturating<isize> as Div<Saturating<isize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u128>) -> <Saturating<u128> as Div<Saturating<u128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u128>) -> <Saturating<u128> as Div<Saturating<u128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u16>) -> <Saturating<u16> as Div<Saturating<u16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u16>) -> <Saturating<u16> as Div<Saturating<u16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u32>) -> <Saturating<u32> as Div<Saturating<u32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u32>) -> <Saturating<u32> as Div<Saturating<u32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u64>) -> <Saturating<u64> as Div<Saturating<u64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u64>) -> <Saturating<u64> as Div<Saturating<u64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u8>) -> <Saturating<u8> as Div<Saturating<u8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<u8>) -> <Saturating<u8> as Div<Saturating<u8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<usize>) -> <Saturating<usize> as Div<Saturating<usize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: &Saturating<usize>) -> <Saturating<usize> as Div<Saturating<usize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<i128>) -> <Saturating<i128> as Div<Saturating<i128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i128>> for Saturating<i128> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i128), Saturating(5i128) / Saturating(2)); assert_eq!(Saturating(i128::MAX), Saturating(i128::MAX) / Saturating(1)); assert_eq!(Saturating(i128::MIN), Saturating(i128::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i128) / Saturating(0); ``` #### type Output = Saturating<i128> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<i128>) -> Saturating<i128> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<i16>) -> <Saturating<i16> as Div<Saturating<i16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i16>> for Saturating<i16> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i16), Saturating(5i16) / Saturating(2)); assert_eq!(Saturating(i16::MAX), Saturating(i16::MAX) / Saturating(1)); assert_eq!(Saturating(i16::MIN), Saturating(i16::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i16) / Saturating(0); ``` #### type Output = Saturating<i16> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<i16>) -> Saturating<i16> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<i32>) -> <Saturating<i32> as Div<Saturating<i32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i32>> for Saturating<i32> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i32), Saturating(5i32) / Saturating(2)); assert_eq!(Saturating(i32::MAX), Saturating(i32::MAX) / Saturating(1)); assert_eq!(Saturating(i32::MIN), Saturating(i32::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i32) / Saturating(0); ``` #### type Output = Saturating<i32> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<i32>) -> Saturating<i32> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<i64>) -> <Saturating<i64> as Div<Saturating<i64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i64>> for Saturating<i64> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i64), Saturating(5i64) / Saturating(2)); assert_eq!(Saturating(i64::MAX), Saturating(i64::MAX) / Saturating(1)); assert_eq!(Saturating(i64::MIN), Saturating(i64::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i64) / Saturating(0); ``` #### type Output = Saturating<i64> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<i64>) -> Saturating<i64> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<i8>) -> <Saturating<i8> as Div<Saturating<i8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i8>> for Saturating<i8> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i8), Saturating(5i8) / Saturating(2)); assert_eq!(Saturating(i8::MAX), Saturating(i8::MAX) / Saturating(1)); assert_eq!(Saturating(i8::MIN), Saturating(i8::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i8) / Saturating(0); ``` #### type Output = Saturating<i8> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<i8>) -> Saturating<i8> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<isize>) -> <Saturating<isize> as Div<Saturating<isize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<isize>> for Saturating<isize> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2isize), Saturating(5isize) / Saturating(2)); assert_eq!(Saturating(isize::MAX), Saturating(isize::MAX) / Saturating(1)); assert_eq!(Saturating(isize::MIN), Saturating(isize::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0isize) / Saturating(0); ``` #### type Output = Saturating<isize> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<isize>) -> Saturating<isize> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<u128>) -> <Saturating<u128> as Div<Saturating<u128>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u128>> for Saturating<u128> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u128), Saturating(5u128) / Saturating(2)); assert_eq!(Saturating(u128::MAX), Saturating(u128::MAX) / Saturating(1)); assert_eq!(Saturating(u128::MIN), Saturating(u128::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u128) / Saturating(0); ``` #### type Output = Saturating<u128> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<u128>) -> Saturating<u128> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<u16>) -> <Saturating<u16> as Div<Saturating<u16>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u16>> for Saturating<u16> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u16), Saturating(5u16) / Saturating(2)); assert_eq!(Saturating(u16::MAX), Saturating(u16::MAX) / Saturating(1)); assert_eq!(Saturating(u16::MIN), Saturating(u16::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u16) / Saturating(0); ``` #### type Output = Saturating<u16> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<u16>) -> Saturating<u16> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<u32>) -> <Saturating<u32> as Div<Saturating<u32>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u32>> for Saturating<u32> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u32), Saturating(5u32) / Saturating(2)); assert_eq!(Saturating(u32::MAX), Saturating(u32::MAX) / Saturating(1)); assert_eq!(Saturating(u32::MIN), Saturating(u32::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u32) / Saturating(0); ``` #### type Output = Saturating<u32> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<u32>) -> Saturating<u32> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<u64>) -> <Saturating<u64> as Div<Saturating<u64>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u64>> for Saturating<u64> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u64), Saturating(5u64) / Saturating(2)); assert_eq!(Saturating(u64::MAX), Saturating(u64::MAX) / Saturating(1)); assert_eq!(Saturating(u64::MIN), Saturating(u64::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u64) / Saturating(0); ``` #### type Output = Saturating<u64> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<u64>) -> Saturating<u64> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<u8>) -> <Saturating<u8> as Div<Saturating<u8>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u8>> for Saturating<u8> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u8), Saturating(5u8) / Saturating(2)); assert_eq!(Saturating(u8::MAX), Saturating(u8::MAX) / Saturating(1)); assert_eq!(Saturating(u8::MIN), Saturating(u8::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u8) / Saturating(0); ``` #### type Output = Saturating<u8> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<u8>) -> Saturating<u8> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div( self, other: Saturating<usize>) -> <Saturating<usize> as Div<Saturating<usize>>>::Output Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<usize>> for Saturating<usize> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2usize), Saturating(5usize) / Saturating(2)); assert_eq!(Saturating(usize::MAX), Saturating(usize::MAX) / Saturating(1)); assert_eq!(Saturating(usize::MIN), Saturating(usize::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0usize) / Saturating(0); ``` #### type Output = Saturating<usize> The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div(self, other: Saturating<usize>) -> Saturating<usize> Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<i128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<i16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<i32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<i64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<i8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<isize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<u128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<u16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<u32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<u64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<u8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &Saturating<usize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &i128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &i16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &i32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &i64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &i8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &isize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &u128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &u16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &u32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &u64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &u8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: &usize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<i128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<i16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<i32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<i64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<i8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<isize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<u128>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<u16>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<u32>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<u64>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<u8>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: Saturating<usize>) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: i128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: i16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: i32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: i64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: i8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: isize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: u128) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: u16) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: u32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: u64) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: u8) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn div\_assign(&mut self, other: usize) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Hash for Saturating<T>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#69)### impl<T> LowerHex for Saturating<T>where T: [LowerHex](../fmt/trait.lowerhex "trait std::fmt::LowerHex"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#70)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i128>) -> <Saturating<i128> as Mul<Saturating<i128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i128>) -> <Saturating<i128> as Mul<Saturating<i128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i16>) -> <Saturating<i16> as Mul<Saturating<i16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i16>) -> <Saturating<i16> as Mul<Saturating<i16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i32>) -> <Saturating<i32> as Mul<Saturating<i32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i32>) -> <Saturating<i32> as Mul<Saturating<i32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i64>) -> <Saturating<i64> as Mul<Saturating<i64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i64>) -> <Saturating<i64> as Mul<Saturating<i64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i8>) -> <Saturating<i8> as Mul<Saturating<i8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<i8>) -> <Saturating<i8> as Mul<Saturating<i8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<isize>) -> <Saturating<isize> as Mul<Saturating<isize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<isize>) -> <Saturating<isize> as Mul<Saturating<isize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u128>) -> <Saturating<u128> as Mul<Saturating<u128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u128>) -> <Saturating<u128> as Mul<Saturating<u128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u16>) -> <Saturating<u16> as Mul<Saturating<u16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u16>) -> <Saturating<u16> as Mul<Saturating<u16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u32>) -> <Saturating<u32> as Mul<Saturating<u32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u32>) -> <Saturating<u32> as Mul<Saturating<u32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u64>) -> <Saturating<u64> as Mul<Saturating<u64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u64>) -> <Saturating<u64> as Mul<Saturating<u64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u8>) -> <Saturating<u8> as Mul<Saturating<u8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<u8>) -> <Saturating<u8> as Mul<Saturating<u8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<usize>) -> <Saturating<usize> as Mul<Saturating<usize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: &Saturating<usize>) -> <Saturating<usize> as Mul<Saturating<usize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<i128>) -> <Saturating<i128> as Mul<Saturating<i128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<i128>) -> Saturating<i128> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<i16>) -> <Saturating<i16> as Mul<Saturating<i16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<i16>) -> Saturating<i16> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<i32>) -> <Saturating<i32> as Mul<Saturating<i32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<i32>) -> Saturating<i32> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<i64>) -> <Saturating<i64> as Mul<Saturating<i64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<i64>) -> Saturating<i64> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<i8>) -> <Saturating<i8> as Mul<Saturating<i8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<i8>) -> Saturating<i8> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<isize>) -> <Saturating<isize> as Mul<Saturating<isize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<isize>) -> Saturating<isize> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<u128>) -> <Saturating<u128> as Mul<Saturating<u128>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<u128>) -> Saturating<u128> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<u16>) -> <Saturating<u16> as Mul<Saturating<u16>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<u16>) -> Saturating<u16> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<u32>) -> <Saturating<u32> as Mul<Saturating<u32>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<u32>) -> Saturating<u32> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<u64>) -> <Saturating<u64> as Mul<Saturating<u64>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<u64>) -> Saturating<u64> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<u8>) -> <Saturating<u8> as Mul<Saturating<u8>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<u8>) -> Saturating<u8> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul( self, other: Saturating<usize>) -> <Saturating<usize> as Mul<Saturating<usize>>>::Output Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul(self, other: Saturating<usize>) -> Saturating<usize> Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<i128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<i16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<i32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<i64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<i8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<isize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<u128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<u16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<u32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<u64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<u8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &Saturating<usize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &i128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &i16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &i32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &i64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &i8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &isize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &u128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &u16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &u32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &u64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &u8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: &usize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<i128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<i16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<i32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<i64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<i8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<isize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<u128>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<u16>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<u32>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<u64>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<u8>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: Saturating<usize>) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: i128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: i16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: i32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: i64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: i8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: isize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: u128) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: u16) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: u32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: u64) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: u8) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn mul\_assign(&mut self, other: usize) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i128> #### type Output = <Saturating<i128> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> <Saturating<i128> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i16> #### type Output = <Saturating<i16> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> <Saturating<i16> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i32> #### type Output = <Saturating<i32> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> <Saturating<i32> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i64> #### type Output = <Saturating<i64> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> <Saturating<i64> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i8> #### type Output = <Saturating<i8> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> <Saturating<i8> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<isize> #### type Output = <Saturating<isize> as Neg>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> <Saturating<isize> as Neg>::Output Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> Saturating<i128> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> Saturating<i16> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> Saturating<i32> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> Saturating<i64> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> Saturating<i8> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)#### fn neg(self) -> Saturating<isize> Performs the unary `-` operation. [Read more](../ops/trait.neg#tymethod.neg) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i128> #### type Output = <Saturating<i128> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<i128> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i16> #### type Output = <Saturating<i16> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<i16> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i32> #### type Output = <Saturating<i32> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<i32> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i64> #### type Output = <Saturating<i64> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<i64> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i8> #### type Output = <Saturating<i8> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<i8> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<isize> #### type Output = <Saturating<isize> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<isize> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u128> #### type Output = <Saturating<u128> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<u128> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u16> #### type Output = <Saturating<u16> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<u16> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u32> #### type Output = <Saturating<u32> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<u32> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u64> #### type Output = <Saturating<u64> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<u64> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u8> #### type Output = <Saturating<u8> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<u8> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<usize> #### type Output = <Saturating<usize> as Not>::Output The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> <Saturating<usize> as Not>::Output Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<i128> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<i16> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<i32> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<i64> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<i8> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<isize> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<u128> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<u16> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<u32> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<u64> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<u8> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `!` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn not(self) -> Saturating<usize> Performs the unary `!` operation. [Read more](../ops/trait.not#tymethod.not) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#62)### impl<T> Octal for Saturating<T>where T: [Octal](../fmt/trait.octal "trait std::fmt::Octal"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#63)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Ord for Saturating<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)#### fn cmp(&self, other: &Saturating<T>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> PartialEq<Saturating<T>> for Saturating<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)#### fn eq(&self, other: &Saturating<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> PartialOrd<Saturating<T>> for Saturating<T>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)#### fn partial\_cmp(&self, other: &Saturating<T>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i128>) -> <Saturating<i128> as Rem<Saturating<i128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i128>) -> <Saturating<i128> as Rem<Saturating<i128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i16>) -> <Saturating<i16> as Rem<Saturating<i16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i16>) -> <Saturating<i16> as Rem<Saturating<i16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i32>) -> <Saturating<i32> as Rem<Saturating<i32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i32>) -> <Saturating<i32> as Rem<Saturating<i32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i64>) -> <Saturating<i64> as Rem<Saturating<i64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i64>) -> <Saturating<i64> as Rem<Saturating<i64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i8>) -> <Saturating<i8> as Rem<Saturating<i8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<i8>) -> <Saturating<i8> as Rem<Saturating<i8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<isize>) -> <Saturating<isize> as Rem<Saturating<isize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<isize>) -> <Saturating<isize> as Rem<Saturating<isize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u128>) -> <Saturating<u128> as Rem<Saturating<u128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u128>) -> <Saturating<u128> as Rem<Saturating<u128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u16>) -> <Saturating<u16> as Rem<Saturating<u16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u16>) -> <Saturating<u16> as Rem<Saturating<u16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u32>) -> <Saturating<u32> as Rem<Saturating<u32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u32>) -> <Saturating<u32> as Rem<Saturating<u32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u64>) -> <Saturating<u64> as Rem<Saturating<u64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u64>) -> <Saturating<u64> as Rem<Saturating<u64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u8>) -> <Saturating<u8> as Rem<Saturating<u8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<u8>) -> <Saturating<u8> as Rem<Saturating<u8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<usize>) -> <Saturating<usize> as Rem<Saturating<usize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: &Saturating<usize>) -> <Saturating<usize> as Rem<Saturating<usize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<i128>) -> <Saturating<i128> as Rem<Saturating<i128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<i128>) -> Saturating<i128> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<i16>) -> <Saturating<i16> as Rem<Saturating<i16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<i16>) -> Saturating<i16> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<i32>) -> <Saturating<i32> as Rem<Saturating<i32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<i32>) -> Saturating<i32> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<i64>) -> <Saturating<i64> as Rem<Saturating<i64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<i64>) -> Saturating<i64> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<i8>) -> <Saturating<i8> as Rem<Saturating<i8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<i8>) -> Saturating<i8> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<isize>) -> <Saturating<isize> as Rem<Saturating<isize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<isize>) -> Saturating<isize> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<u128>) -> <Saturating<u128> as Rem<Saturating<u128>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<u128>) -> Saturating<u128> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<u16>) -> <Saturating<u16> as Rem<Saturating<u16>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<u16>) -> Saturating<u16> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<u32>) -> <Saturating<u32> as Rem<Saturating<u32>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<u32>) -> Saturating<u32> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<u64>) -> <Saturating<u64> as Rem<Saturating<u64>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<u64>) -> Saturating<u64> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<u8>) -> <Saturating<u8> as Rem<Saturating<u8>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<u8>) -> Saturating<u8> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem( self, other: Saturating<usize>) -> <Saturating<usize> as Rem<Saturating<usize>>>::Output Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `%` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem(self, other: Saturating<usize>) -> Saturating<usize> Performs the `%` operation. [Read more](../ops/trait.rem#tymethod.rem) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<i128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<i16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<i32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<i64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<i8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<isize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<u128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<u16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<u32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<u64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<u8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &Saturating<usize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &i128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &i16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &i32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &i64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &i8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &isize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &u128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &u16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &u32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &u64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &u8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: &usize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<i128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<i16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<i32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<i64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<i8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<isize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<u128>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<u16>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<u32>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<u64>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<u8>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: Saturating<usize>) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: i128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: i16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: i32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: i64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: i8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: isize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: u128) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: u16) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: u32) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: u64) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: u8) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn rem\_assign(&mut self, other: usize) Performs the `%=` operation. [Read more](../ops/trait.remassign#tymethod.rem_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i128> #### type Output = <Saturating<i128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i16> #### type Output = <Saturating<i16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i32> #### type Output = <Saturating<i32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i64> #### type Output = <Saturating<i64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i8> #### type Output = <Saturating<i8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<isize> #### type Output = <Saturating<isize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<isize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u128> #### type Output = <Saturating<u128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u16> #### type Output = <Saturating<u16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u32> #### type Output = <Saturating<u32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u64> #### type Output = <Saturating<u64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u8> #### type Output = <Saturating<u8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<usize> #### type Output = <Saturating<usize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<usize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i128> #### type Output = <Saturating<i128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i16> #### type Output = <Saturating<i16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i32> #### type Output = <Saturating<i32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i64> #### type Output = <Saturating<i64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i8> #### type Output = <Saturating<i8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<i8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<isize> #### type Output = <Saturating<isize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<isize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u128> #### type Output = <Saturating<u128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u16> #### type Output = <Saturating<u16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u32> #### type Output = <Saturating<u32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u64> #### type Output = <Saturating<u64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u8> #### type Output = <Saturating<u8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<u8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<usize> #### type Output = <Saturating<usize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: &usize) -> <Saturating<usize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<i128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<i16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<i32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<i64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<i8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<isize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<u128> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<u16> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<u32> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<u64> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<u8> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Shl<usize>>::Output The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> <Saturating<usize> as Shl<usize>>::Output Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<i128> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<i16> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<i32> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<i64> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<i8> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<isize> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<u128> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<u16> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<u32> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<u64> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<u8> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `<<` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl(self, other: usize) -> Saturating<usize> Performs the `<<` operation. [Read more](../ops/trait.shl#tymethod.shl) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: &usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shl\_assign(&mut self, other: usize) Performs the `<<=` operation. [Read more](../ops/trait.shlassign#tymethod.shl_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i128> #### type Output = <Saturating<i128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i16> #### type Output = <Saturating<i16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i32> #### type Output = <Saturating<i32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i64> #### type Output = <Saturating<i64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i8> #### type Output = <Saturating<i8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<isize> #### type Output = <Saturating<isize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<isize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u128> #### type Output = <Saturating<u128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u16> #### type Output = <Saturating<u16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u32> #### type Output = <Saturating<u32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u64> #### type Output = <Saturating<u64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u8> #### type Output = <Saturating<u8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<usize> #### type Output = <Saturating<usize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<usize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i128> #### type Output = <Saturating<i128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i16> #### type Output = <Saturating<i16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i32> #### type Output = <Saturating<i32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i64> #### type Output = <Saturating<i64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i8> #### type Output = <Saturating<i8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<i8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<isize> #### type Output = <Saturating<isize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<isize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u128> #### type Output = <Saturating<u128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u16> #### type Output = <Saturating<u16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u32> #### type Output = <Saturating<u32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u64> #### type Output = <Saturating<u64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u8> #### type Output = <Saturating<u8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<u8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<usize> #### type Output = <Saturating<usize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: &usize) -> <Saturating<usize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<i128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<i16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<i32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<i64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<i8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<isize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<u128> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<u16> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<u32> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<u64> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<u8> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Shr<usize>>::Output The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> <Saturating<usize> as Shr<usize>>::Output Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<i128> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<i16> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<i32> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<i64> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<i8> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<isize> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<u128> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<u16> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<u32> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<u64> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<u8> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `>>` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr(self, other: usize) -> Saturating<usize> Performs the `>>` operation. [Read more](../ops/trait.shr#tymethod.shr) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: &usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)#### fn shr\_assign(&mut self, other: usize) Performs the `>>=` operation. [Read more](../ops/trait.shrassign#tymethod.shr_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i128>) -> <Saturating<i128> as Sub<Saturating<i128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i128>) -> <Saturating<i128> as Sub<Saturating<i128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i16>) -> <Saturating<i16> as Sub<Saturating<i16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i16>) -> <Saturating<i16> as Sub<Saturating<i16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i32>) -> <Saturating<i32> as Sub<Saturating<i32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i32>) -> <Saturating<i32> as Sub<Saturating<i32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i64>) -> <Saturating<i64> as Sub<Saturating<i64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i64>) -> <Saturating<i64> as Sub<Saturating<i64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i8>) -> <Saturating<i8> as Sub<Saturating<i8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<i8>) -> <Saturating<i8> as Sub<Saturating<i8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<isize>) -> <Saturating<isize> as Sub<Saturating<isize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<isize>) -> <Saturating<isize> as Sub<Saturating<isize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u128>) -> <Saturating<u128> as Sub<Saturating<u128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u128>) -> <Saturating<u128> as Sub<Saturating<u128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u16>) -> <Saturating<u16> as Sub<Saturating<u16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u16>) -> <Saturating<u16> as Sub<Saturating<u16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u32>) -> <Saturating<u32> as Sub<Saturating<u32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u32>) -> <Saturating<u32> as Sub<Saturating<u32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u64>) -> <Saturating<u64> as Sub<Saturating<u64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u64>) -> <Saturating<u64> as Sub<Saturating<u64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u8>) -> <Saturating<u8> as Sub<Saturating<u8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<u8>) -> <Saturating<u8> as Sub<Saturating<u8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<usize>) -> <Saturating<usize> as Sub<Saturating<usize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: &Saturating<usize>) -> <Saturating<usize> as Sub<Saturating<usize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<i128>) -> <Saturating<i128> as Sub<Saturating<i128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<i128>) -> Saturating<i128> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<i16>) -> <Saturating<i16> as Sub<Saturating<i16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<i16>) -> Saturating<i16> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<i32>) -> <Saturating<i32> as Sub<Saturating<i32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<i32>) -> Saturating<i32> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<i64>) -> <Saturating<i64> as Sub<Saturating<i64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<i64>) -> Saturating<i64> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<i8>) -> <Saturating<i8> as Sub<Saturating<i8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<i8>) -> Saturating<i8> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<isize>) -> <Saturating<isize> as Sub<Saturating<isize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<isize>) -> Saturating<isize> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<u128>) -> <Saturating<u128> as Sub<Saturating<u128>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<u128>) -> Saturating<u128> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<u16>) -> <Saturating<u16> as Sub<Saturating<u16>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<u16>) -> Saturating<u16> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<u32>) -> <Saturating<u32> as Sub<Saturating<u32>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<u32>) -> Saturating<u32> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<u64>) -> <Saturating<u64> as Sub<Saturating<u64>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<u64>) -> Saturating<u64> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<u8>) -> <Saturating<u8> as Sub<Saturating<u8>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<u8>) -> Saturating<u8> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub( self, other: Saturating<usize>) -> <Saturating<usize> as Sub<Saturating<usize>>>::Output Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub(self, other: Saturating<usize>) -> Saturating<usize> Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<i128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<i16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<i32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<i64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<i8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<isize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<u128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<u16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<u32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<u64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<u8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &Saturating<usize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &i128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &i16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &i32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &i64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &i8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &isize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &u128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &u16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &u32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &u64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &u8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: &usize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<i128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<i16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<i32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<i64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<i8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<isize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<u128>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<u16>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<u32>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<u64>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<u8>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: Saturating<usize>) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: i128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: i16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: i32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: i64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: i8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: isize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: u128) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: u16) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: u32) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: u64) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: u8) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)#### fn sub\_assign(&mut self, other: usize) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#76)### impl<T> UpperHex for Saturating<T>where T: [UpperHex](../fmt/trait.upperhex "trait std::fmt::UpperHex"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#77)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Copy for Saturating<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Eq for Saturating<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> StructuralEq for Saturating<T> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> StructuralPartialEq for Saturating<T> Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Saturating<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Saturating<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Saturating<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Saturating<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Saturating<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::default Module std::default =================== The `Default` trait for types with a default value. Macros ------ [Default](macro.default "std::default::Default macro") Derive macro generating an impl of the trait `Default`. Traits ------ [Default](trait.default "std::default::Default trait") A trait for giving a type a useful default value. Functions --------- [default](fn.default "std::default::default fn")Experimental Return the default value of a type according to the `Default` trait. rust Trait std::default::Default Trait std::default::Default =========================== ``` pub trait Default { fn default() -> Self; } ``` A trait for giving a type a useful default value. Sometimes, you want to fall back to some kind of default value, and don’t particularly care what it is. This comes up often with `struct`s that define a set of options: ``` struct SomeOptions { foo: i32, bar: f32, } ``` How can we define some default values? You can use `Default`: ``` #[derive(Default)] struct SomeOptions { foo: i32, bar: f32, } fn main() { let options: SomeOptions = Default::default(); } ``` Now, you get all of the default values. Rust implements `Default` for various primitives types. If you want to override a particular option, but still retain the other defaults: ``` fn main() { let options = SomeOptions { foo: 42, ..Default::default() }; } ``` ### Derivable This trait can be used with `#[derive]` if all of the type’s fields implement `Default`. When `derive`d, it will use the default value for each field’s type. #### `enum`s When using `#[derive(Default)]` on an `enum`, you need to choose which unit variant will be default. You do this by placing the `#[default]` attribute on the variant. ``` #[derive(Default)] enum Kind { #[default] A, B, C, } ``` You cannot use the `#[default]` attribute on non-unit or non-exhaustive variants. ### How can I implement `Default`? Provide an implementation for the `default()` method that returns the value of your type that should be the default: ``` enum Kind { A, B, C, } impl Default for Kind { fn default() -> Self { Kind::A } } ``` Examples -------- ``` #[derive(Default)] struct SomeOptions { foo: i32, bar: f32, } ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/default.rs.html#133)#### fn default() -> Self Returns the “default value” for a type. Default values are often some kind of initial value, identity value, or anything else that may make sense as a default. ##### Examples Using built-in default values: ``` let i: i8 = Default::default(); let (x, y): (Option<String>, f64) = Default::default(); let (a, b, (c, d)): (i32, u32, (bool, bool)) = Default::default(); ``` Making your own: ``` enum Kind { A, B, C, } impl Default for Kind { fn default() -> Self { Kind::A } } ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2572)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for &str [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#168)1.10.0 · ### impl Default for &CStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1123-1129)1.9.0 · ### impl Default for &OsStr [source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2581)1.28.0 · ### impl Default for &mut str [source](https://doc.rust-lang.org/src/core/default.rs.html#204)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for bool [source](https://doc.rust-lang.org/src/core/default.rs.html#205)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for char [source](https://doc.rust-lang.org/src/core/default.rs.html#221)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for f32 [source](https://doc.rust-lang.org/src/core/default.rs.html#222)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for f64 [source](https://doc.rust-lang.org/src/core/default.rs.html#215)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for i8 [source](https://doc.rust-lang.org/src/core/default.rs.html#216)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for i16 [source](https://doc.rust-lang.org/src/core/default.rs.html#217)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for i32 [source](https://doc.rust-lang.org/src/core/default.rs.html#218)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for i64 [source](https://doc.rust-lang.org/src/core/default.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for i128 [source](https://doc.rust-lang.org/src/core/default.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for isize [source](https://doc.rust-lang.org/src/core/default.rs.html#208)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for u8 [source](https://doc.rust-lang.org/src/core/default.rs.html#209)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for u16 [source](https://doc.rust-lang.org/src/core/default.rs.html#210)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for u32 [source](https://doc.rust-lang.org/src/core/default.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for u64 [source](https://doc.rust-lang.org/src/core/default.rs.html#212)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for u128 [source](https://doc.rust-lang.org/src/core/default.rs.html#203)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for () [source](https://doc.rust-lang.org/src/core/default.rs.html#207)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for usize [source](https://doc.rust-lang.org/src/alloc/alloc.rs.html#53)### impl Default for Global [source](https://doc.rust-lang.org/src/std/alloc.rs.html#130)1.28.0 · ### impl Default for System [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1265)1.17.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#912)1.17.0 · ### impl Default for Box<CStr, Global> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1114-1120)1.17.0 · ### impl Default for Box<OsStr> [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3172-3181)1.13.0 · ### impl Default for DefaultHasher [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3205-3211)1.7.0 · ### impl Default for RandomState [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#737)1.10.0 · ### impl Default for CString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#528-534)1.9.0 · ### impl Default for OsString [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#98)### impl Default for Error [source](https://doc.rust-lang.org/src/std/fs.rs.html#188)### impl Default for FileTimes [source](https://doc.rust-lang.org/src/core/hash/sip.rs.html#48)### impl Default for SipHasher [source](https://doc.rust-lang.org/src/std/io/util.rs.html#17)### impl Default for std::io::Empty [source](https://doc.rust-lang.org/src/std/io/util.rs.html#189)### impl Default for Sink [source](https://doc.rust-lang.org/src/core/marker.rs.html#776)1.33.0 · ### impl Default for PhantomPinned [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Default for RangeFull [source](https://doc.rust-lang.org/src/std/path.rs.html#1736-1741)1.17.0 · ### impl Default for PathBuf [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2237)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for String [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#151)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for AtomicBool [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2675-2693)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicI8 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2715-2733)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicI16 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2755-2773)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicI32 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2795-2813)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicI64 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2922-2926)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for AtomicIsize [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2695-2713)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicU8 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2735-2753)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicU16 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2775-2793)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicU32 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2815-2833)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for AtomicU64 [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2922-2926)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl Default for AtomicUsize [source](https://doc.rust-lang.org/src/std/sync/condvar.rs.html#559-564)1.10.0 · ### impl Default for Condvar [source](https://doc.rust-lang.org/src/core/time.rs.html#70)1.3.0 · ### impl Default for Duration [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#411)1.11.0 · ### impl<B> Default for Cow<'\_, B>where B: [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned")>::[Owned](../borrow/trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#784)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl<H> Default for BuildHasherDefault<H> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Default for Range<Idx>where Idx: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2164)### impl<K, V> Default for BTreeMap<K, V, Global> [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1313-1322)### impl<K, V, S> Default for HashMap<K, V, S>where S: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4211)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for &[T] [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4220)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl<T> Default for &mut [T] [source](https://doc.rust-lang.org/src/core/option.rs.html#1912)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for Option<T> [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl<T> Default for [T; 0] [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 1]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 2]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 3]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 4]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 5]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 6]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 7]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 8]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 9]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 10]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 11]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 12]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 13]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 14]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 15]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 16]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 17]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 18]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 19]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 20]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 21]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 22]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 23]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 24]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 25]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 26]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 27]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 28]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 29]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 30]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 31]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)1.4.0 · ### impl<T> Default for [T; 32]where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)### impl<T> Default for (T₁, T₂, …, Tₙ)where T: [Default](trait.default "trait std::default::Default"), This trait is implemented for tuples up to twelve items long. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1255)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for Box<[T], Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1244)### impl<T> Default for Box<T, Global>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#268)### impl<T> Default for Cell<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#92)### impl<T> Default for LazyCell<T, fn() -> T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#237)### impl<T> Default for OnceCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#1179)### impl<T> Default for RefCell<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#2091)### impl<T> Default for SyncUnsafeCell<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#2001)1.10.0 · ### impl<T> Default for UnsafeCell<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)1.19.0 · ### impl<T> Default for Reverse<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1371)### impl<T> Default for BTreeSet<T, Global> [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#344)### impl<T> Default for BinaryHeap<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#401)### impl<T> Default for LinkedList<T> [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#162)### impl<T> Default for VecDeque<T, Global> [source](https://doc.rust-lang.org/src/core/iter/sources/empty.rs.html#90)1.2.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl<T> Default for std::iter::Empty<T> [source](https://doc.rust-lang.org/src/core/marker.rs.html#680)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for PhantomData<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/mem/manually_drop.rs.html#48)1.20.0 · ### impl<T> Default for ManuallyDrop<T>where T: [Default](trait.default "trait std::default::Default") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Default for Saturating<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Default for Wrapping<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#283)1.62.0 · ### impl<T> Default for AssertUnwindSafe<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1600)### impl<T> Default for Rc<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2539)1.10.0 · ### impl<T> Default for std::rc::Weak<T> [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#183)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for AtomicPtr<T> [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2437)### impl<T> Default for Arc<T>where T: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/sync/exclusive.rs.html#82)### impl<T> Default for Exclusive<T>where T: [Default](trait.default "trait std::default::Default") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#347-364)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for OnceLock<T> [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2155)1.10.0 · ### impl<T> Default for std::sync::Weak<T> [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2929)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for Vec<T, Global> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1111-1120)### impl<T, S> Default for HashSet<T, S>where S: [Default](trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#279)### impl<T, const LANES: usize> Default for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#488)### impl<T, const LANES: usize> Default for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement") + [Default](trait.default "trait std::default::Default"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#73)### impl<T: Default> Default for Cursor<T> [source](https://doc.rust-lang.org/src/std/sync/lazy_lock.rs.html#92-97)### impl<T: Default> Default for LazyLock<T> [source](https://doc.rust-lang.org/src/std/sync/rwlock.rs.html#505-510)1.10.0 · ### impl<T: Default> Default for RwLock<T> [source](https://doc.rust-lang.org/src/std/sync/mutex.rs.html#468-473)1.10.0 · ### impl<T: ?Sized + Default> Default for Mutex<T>
programming_docs
rust Macro std::default::Default Macro std::default::Default =========================== ``` pub macro Default($item:item) { ... } ``` Derive macro generating an impl of the trait `Default`. rust Function std::default::default Function std::default::default ============================== ``` pub fn default<T>() -> Twhere    T: Default, ``` 🔬This is a nightly-only experimental API. (`default_free_fn` [#73014](https://github.com/rust-lang/rust/issues/73014)) Return the default value of a type according to the `Default` trait. The type to return is inferred from context; this is equivalent to `Default::default()` but shorter to type. For example: ``` #![feature(default_free_fn)] use std::default::default; #[derive(Default)] struct AppConfig { foo: FooConfig, bar: BarConfig, } #[derive(Default)] struct FooConfig { foo: i32, } #[derive(Default)] struct BarConfig { bar: f32, baz: u8, } fn main() { let options = AppConfig { foo: default(), bar: BarConfig { bar: 10.1, ..default() }, }; } ``` rust Constant std::f32::NAN Constant std::f32::NAN ====================== ``` pub const NAN: f32 = f32::NAN; // NaNf32 ``` 👎Deprecating in a future Rust version: replaced by the `NAN` associated constant on `f32` Not a Number (NaN). Use [`f32::NAN`](../primitive.f32#associatedconstant.NAN "f32::NAN") instead. Examples -------- ``` // deprecated way let nan = std::f32::NAN; // intended way let nan = f32::NAN; ``` rust Constant std::f32::MIN_10_EXP Constant std::f32::MIN\_10\_EXP =============================== ``` pub const MIN_10_EXP: i32 = f32::MIN_10_EXP; // -37i32 ``` 👎Deprecating in a future Rust version: replaced by the `MIN_10_EXP` associated constant on `f32` Minimum possible normal power of 10 exponent. Use [`f32::MIN_10_EXP`](../primitive.f32#associatedconstant.MIN_10_EXP "f32::MIN_10_EXP") instead. Examples -------- ``` // deprecated way let min = std::f32::MIN_10_EXP; // intended way let min = f32::MIN_10_EXP; ``` rust Module std::f32 Module std::f32 =============== Constants for the `f32` single-precision floating point type. *[See also the `f32` primitive type](../primitive.f32).* Mathematically significant numbers are provided in the `consts` sub-module. For the constants defined directly in this module (as distinct from those defined in the `consts` sub-module), new code should instead use the associated constants defined directly on the `f32` type. Modules ------- [consts](consts/index "std::f32::consts mod") Basic mathematical constants. Constants --------- [DIGITS](constant.digits "std::f32::DIGITS constant")Deprecation planned Approximate number of significant digits in base 10. Use [`f32::DIGITS`](../primitive.f32#associatedconstant.DIGITS "f32::DIGITS") instead. [EPSILON](constant.epsilon "std::f32::EPSILON constant")Deprecation planned [Machine epsilon](https://en.wikipedia.org/wiki/Machine_epsilon) value for `f32`. Use [`f32::EPSILON`](../primitive.f32#associatedconstant.EPSILON "f32::EPSILON") instead. [INFINITY](constant.infinity "std::f32::INFINITY constant")Deprecation planned Infinity (∞). Use [`f32::INFINITY`](../primitive.f32#associatedconstant.INFINITY "f32::INFINITY") instead. [MANTISSA\_DIGITS](constant.mantissa_digits "std::f32::MANTISSA_DIGITS constant")Deprecation planned Number of significant digits in base 2. Use [`f32::MANTISSA_DIGITS`](../primitive.f32#associatedconstant.MANTISSA_DIGITS "f32::MANTISSA_DIGITS") instead. [MAX](constant.max "std::f32::MAX constant")Deprecation planned Largest finite `f32` value. Use [`f32::MAX`](../primitive.f32#associatedconstant.MAX "f32::MAX") instead. [MAX\_10\_EXP](constant.max_10_exp "std::f32::MAX_10_EXP constant")Deprecation planned Maximum possible power of 10 exponent. Use [`f32::MAX_10_EXP`](../primitive.f32#associatedconstant.MAX_10_EXP "f32::MAX_10_EXP") instead. [MAX\_EXP](constant.max_exp "std::f32::MAX_EXP constant")Deprecation planned Maximum possible power of 2 exponent. Use [`f32::MAX_EXP`](../primitive.f32#associatedconstant.MAX_EXP "f32::MAX_EXP") instead. [MIN](constant.min "std::f32::MIN constant")Deprecation planned Smallest finite `f32` value. Use [`f32::MIN`](../primitive.f32#associatedconstant.MIN "f32::MIN") instead. [MIN\_10\_EXP](constant.min_10_exp "std::f32::MIN_10_EXP constant")Deprecation planned Minimum possible normal power of 10 exponent. Use [`f32::MIN_10_EXP`](../primitive.f32#associatedconstant.MIN_10_EXP "f32::MIN_10_EXP") instead. [MIN\_EXP](constant.min_exp "std::f32::MIN_EXP constant")Deprecation planned One greater than the minimum possible normal power of 2 exponent. Use [`f32::MIN_EXP`](../primitive.f32#associatedconstant.MIN_EXP "f32::MIN_EXP") instead. [MIN\_POSITIVE](constant.min_positive "std::f32::MIN_POSITIVE constant")Deprecation planned Smallest positive normal `f32` value. Use [`f32::MIN_POSITIVE`](../primitive.f32#associatedconstant.MIN_POSITIVE "f32::MIN_POSITIVE") instead. [NAN](constant.nan "std::f32::NAN constant")Deprecation planned Not a Number (NaN). Use [`f32::NAN`](../primitive.f32#associatedconstant.NAN "f32::NAN") instead. [NEG\_INFINITY](constant.neg_infinity "std::f32::NEG_INFINITY constant")Deprecation planned Negative infinity (−∞). Use [`f32::NEG_INFINITY`](../primitive.f32#associatedconstant.NEG_INFINITY "f32::NEG_INFINITY") instead. [RADIX](constant.radix "std::f32::RADIX constant")Deprecation planned The radix or base of the internal representation of `f32`. Use [`f32::RADIX`](../primitive.f32#associatedconstant.RADIX "f32::RADIX") instead. rust Constant std::f32::MAX Constant std::f32::MAX ====================== ``` pub const MAX: f32 = f32::MAX; // 3.40282347E+38f32 ``` 👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on `f32` Largest finite `f32` value. Use [`f32::MAX`](../primitive.f32#associatedconstant.MAX "f32::MAX") instead. Examples -------- ``` // deprecated way let max = std::f32::MAX; // intended way let max = f32::MAX; ``` rust Constant std::f32::MIN Constant std::f32::MIN ====================== ``` pub const MIN: f32 = f32::MIN; // -3.40282347E+38f32 ``` 👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on `f32` Smallest finite `f32` value. Use [`f32::MIN`](../primitive.f32#associatedconstant.MIN "f32::MIN") instead. Examples -------- ``` // deprecated way let min = std::f32::MIN; // intended way let min = f32::MIN; ``` rust Constant std::f32::EPSILON Constant std::f32::EPSILON ========================== ``` pub const EPSILON: f32 = f32::EPSILON; // 1.1920929E-7f32 ``` 👎Deprecating in a future Rust version: replaced by the `EPSILON` associated constant on `f32` [Machine epsilon](https://en.wikipedia.org/wiki/Machine_epsilon) value for `f32`. Use [`f32::EPSILON`](../primitive.f32#associatedconstant.EPSILON "f32::EPSILON") instead. This is the difference between `1.0` and the next larger representable number. Examples -------- ``` // deprecated way let e = std::f32::EPSILON; // intended way let e = f32::EPSILON; ``` rust Constant std::f32::MAX_10_EXP Constant std::f32::MAX\_10\_EXP =============================== ``` pub const MAX_10_EXP: i32 = f32::MAX_10_EXP; // 38i32 ``` 👎Deprecating in a future Rust version: replaced by the `MAX_10_EXP` associated constant on `f32` Maximum possible power of 10 exponent. Use [`f32::MAX_10_EXP`](../primitive.f32#associatedconstant.MAX_10_EXP "f32::MAX_10_EXP") instead. Examples -------- ``` // deprecated way let max = std::f32::MAX_10_EXP; // intended way let max = f32::MAX_10_EXP; ``` rust Constant std::f32::MIN_EXP Constant std::f32::MIN\_EXP =========================== ``` pub const MIN_EXP: i32 = f32::MIN_EXP; // -125i32 ``` 👎Deprecating in a future Rust version: replaced by the `MIN_EXP` associated constant on `f32` One greater than the minimum possible normal power of 2 exponent. Use [`f32::MIN_EXP`](../primitive.f32#associatedconstant.MIN_EXP "f32::MIN_EXP") instead. Examples -------- ``` // deprecated way let min = std::f32::MIN_EXP; // intended way let min = f32::MIN_EXP; ``` rust Constant std::f32::RADIX Constant std::f32::RADIX ======================== ``` pub const RADIX: u32 = f32::RADIX; // 2u32 ``` 👎Deprecating in a future Rust version: replaced by the `RADIX` associated constant on `f32` The radix or base of the internal representation of `f32`. Use [`f32::RADIX`](../primitive.f32#associatedconstant.RADIX "f32::RADIX") instead. Examples -------- ``` // deprecated way let r = std::f32::RADIX; // intended way let r = f32::RADIX; ``` rust Constant std::f32::MIN_POSITIVE Constant std::f32::MIN\_POSITIVE ================================ ``` pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE; // 1.17549435E-38f32 ``` 👎Deprecating in a future Rust version: replaced by the `MIN_POSITIVE` associated constant on `f32` Smallest positive normal `f32` value. Use [`f32::MIN_POSITIVE`](../primitive.f32#associatedconstant.MIN_POSITIVE "f32::MIN_POSITIVE") instead. Examples -------- ``` // deprecated way let min = std::f32::MIN_POSITIVE; // intended way let min = f32::MIN_POSITIVE; ``` rust Constant std::f32::MAX_EXP Constant std::f32::MAX\_EXP =========================== ``` pub const MAX_EXP: i32 = f32::MAX_EXP; // 128i32 ``` 👎Deprecating in a future Rust version: replaced by the `MAX_EXP` associated constant on `f32` Maximum possible power of 2 exponent. Use [`f32::MAX_EXP`](../primitive.f32#associatedconstant.MAX_EXP "f32::MAX_EXP") instead. Examples -------- ``` // deprecated way let max = std::f32::MAX_EXP; // intended way let max = f32::MAX_EXP; ``` rust Constant std::f32::MANTISSA_DIGITS Constant std::f32::MANTISSA\_DIGITS =================================== ``` pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS; // 24u32 ``` 👎Deprecating in a future Rust version: replaced by the `MANTISSA_DIGITS` associated constant on `f32` Number of significant digits in base 2. Use [`f32::MANTISSA_DIGITS`](../primitive.f32#associatedconstant.MANTISSA_DIGITS "f32::MANTISSA_DIGITS") instead. Examples -------- ``` // deprecated way let d = std::f32::MANTISSA_DIGITS; // intended way let d = f32::MANTISSA_DIGITS; ``` rust Constant std::f32::INFINITY Constant std::f32::INFINITY =========================== ``` pub const INFINITY: f32 = f32::INFINITY; // +Inff32 ``` 👎Deprecating in a future Rust version: replaced by the `INFINITY` associated constant on `f32` Infinity (∞). Use [`f32::INFINITY`](../primitive.f32#associatedconstant.INFINITY "f32::INFINITY") instead. Examples -------- ``` // deprecated way let inf = std::f32::INFINITY; // intended way let inf = f32::INFINITY; ``` rust Constant std::f32::DIGITS Constant std::f32::DIGITS ========================= ``` pub const DIGITS: u32 = f32::DIGITS; // 6u32 ``` 👎Deprecating in a future Rust version: replaced by the `DIGITS` associated constant on `f32` Approximate number of significant digits in base 10. Use [`f32::DIGITS`](../primitive.f32#associatedconstant.DIGITS "f32::DIGITS") instead. Examples -------- ``` // deprecated way let d = std::f32::DIGITS; // intended way let d = f32::DIGITS; ``` rust Constant std::f32::NEG_INFINITY Constant std::f32::NEG\_INFINITY ================================ ``` pub const NEG_INFINITY: f32 = f32::NEG_INFINITY; // -Inff32 ``` 👎Deprecating in a future Rust version: replaced by the `NEG_INFINITY` associated constant on `f32` Negative infinity (−∞). Use [`f32::NEG_INFINITY`](../primitive.f32#associatedconstant.NEG_INFINITY "f32::NEG_INFINITY") instead. Examples -------- ``` // deprecated way let ninf = std::f32::NEG_INFINITY; // intended way let ninf = f32::NEG_INFINITY; ``` rust Constant std::f32::consts::FRAC_PI_6 Constant std::f32::consts::FRAC\_PI\_6 ====================================== ``` pub const FRAC_PI_6: f32 = 0.52359877559829887307710723054658381f32; // 0.52359879f32 ``` π/6 rust Constant std::f32::consts::E Constant std::f32::consts::E ============================ ``` pub const E: f32 = 2.71828182845904523536028747135266250f32; // 2.71828175f32 ``` Euler’s number (e) rust Module std::f32::consts Module std::f32::consts ======================= Basic mathematical constants. Constants --------- [E](constant.e "std::f32::consts::E constant") Euler’s number (e) [FRAC\_1\_PI](constant.frac_1_pi "std::f32::consts::FRAC_1_PI constant") 1/π [FRAC\_1\_SQRT\_2](constant.frac_1_sqrt_2 "std::f32::consts::FRAC_1_SQRT_2 constant") 1/sqrt(2) [FRAC\_2\_PI](constant.frac_2_pi "std::f32::consts::FRAC_2_PI constant") 2/π [FRAC\_2\_SQRT\_PI](constant.frac_2_sqrt_pi "std::f32::consts::FRAC_2_SQRT_PI constant") 2/sqrt(π) [FRAC\_PI\_2](constant.frac_pi_2 "std::f32::consts::FRAC_PI_2 constant") π/2 [FRAC\_PI\_3](constant.frac_pi_3 "std::f32::consts::FRAC_PI_3 constant") π/3 [FRAC\_PI\_4](constant.frac_pi_4 "std::f32::consts::FRAC_PI_4 constant") π/4 [FRAC\_PI\_6](constant.frac_pi_6 "std::f32::consts::FRAC_PI_6 constant") π/6 [FRAC\_PI\_8](constant.frac_pi_8 "std::f32::consts::FRAC_PI_8 constant") π/8 [LN\_2](constant.ln_2 "std::f32::consts::LN_2 constant") ln(2) [LN\_10](constant.ln_10 "std::f32::consts::LN_10 constant") ln(10) [LOG2\_10](constant.log2_10 "std::f32::consts::LOG2_10 constant") log2(10) [LOG2\_E](constant.log2_e "std::f32::consts::LOG2_E constant") log2(e) [LOG10\_2](constant.log10_2 "std::f32::consts::LOG10_2 constant") log10(2) [LOG10\_E](constant.log10_e "std::f32::consts::LOG10_E constant") log10(e) [PI](constant.pi "std::f32::consts::PI constant") Archimedes’ constant (π) [SQRT\_2](constant.sqrt_2 "std::f32::consts::SQRT_2 constant") sqrt(2) [TAU](constant.tau "std::f32::consts::TAU constant") The full circle constant (τ) rust Constant std::f32::consts::LOG2_10 Constant std::f32::consts::LOG2\_10 =================================== ``` pub const LOG2_10: f32 = 3.32192809488736234787031942948939018f32; // 3.32192802f32 ``` log2(10) rust Constant std::f32::consts::PI Constant std::f32::consts::PI ============================= ``` pub const PI: f32 = 3.14159265358979323846264338327950288f32; // 3.14159274f32 ``` Archimedes’ constant (π) rust Constant std::f32::consts::FRAC_PI_2 Constant std::f32::consts::FRAC\_PI\_2 ====================================== ``` pub const FRAC_PI_2: f32 = 1.57079632679489661923132169163975144f32; // 1.57079637f32 ``` π/2 rust Constant std::f32::consts::LOG10_2 Constant std::f32::consts::LOG10\_2 =================================== ``` pub const LOG10_2: f32 = 0.301029995663981195213738894724493027f32; // 0.30103001f32 ``` log10(2) rust Constant std::f32::consts::FRAC_PI_3 Constant std::f32::consts::FRAC\_PI\_3 ====================================== ``` pub const FRAC_PI_3: f32 = 1.04719755119659774615421446109316763f32; // 1.04719758f32 ``` π/3 rust Constant std::f32::consts::SQRT_2 Constant std::f32::consts::SQRT\_2 ================================== ``` pub const SQRT_2: f32 = 1.41421356237309504880168872420969808f32; // 1.41421354f32 ``` sqrt(2) rust Constant std::f32::consts::LOG10_E Constant std::f32::consts::LOG10\_E =================================== ``` pub const LOG10_E: f32 = 0.434294481903251827651128918916605082f32; // 0.434294492f32 ``` log10(e) rust Constant std::f32::consts::FRAC_1_PI Constant std::f32::consts::FRAC\_1\_PI ====================================== ``` pub const FRAC_1_PI: f32 = 0.318309886183790671537767526745028724f32; // 0.318309873f32 ``` 1/π rust Constant std::f32::consts::FRAC_2_SQRT_PI Constant std::f32::consts::FRAC\_2\_SQRT\_PI ============================================ ``` pub const FRAC_2_SQRT_PI: f32 = 1.12837916709551257389615890312154517f32; // 1.12837923f32 ``` 2/sqrt(π) rust Constant std::f32::consts::FRAC_PI_4 Constant std::f32::consts::FRAC\_PI\_4 ====================================== ``` pub const FRAC_PI_4: f32 = 0.785398163397448309615660845819875721f32; // 0.785398185f32 ``` π/4 rust Constant std::f32::consts::LN_10 Constant std::f32::consts::LN\_10 ================================= ``` pub const LN_10: f32 = 2.30258509299404568401799145468436421f32; // 2.30258512f32 ``` ln(10) rust Constant std::f32::consts::FRAC_1_SQRT_2 Constant std::f32::consts::FRAC\_1\_SQRT\_2 =========================================== ``` pub const FRAC_1_SQRT_2: f32 = 0.707106781186547524400844362104849039f32; // 0.707106769f32 ``` 1/sqrt(2) rust Constant std::f32::consts::FRAC_PI_8 Constant std::f32::consts::FRAC\_PI\_8 ====================================== ``` pub const FRAC_PI_8: f32 = 0.39269908169872415480783042290993786f32; // 0.392699093f32 ``` π/8 rust Constant std::f32::consts::TAU Constant std::f32::consts::TAU ============================== ``` pub const TAU: f32 = 6.28318530717958647692528676655900577f32; // 6.28318548f32 ``` The full circle constant (τ) Equal to 2π. rust Constant std::f32::consts::FRAC_2_PI Constant std::f32::consts::FRAC\_2\_PI ====================================== ``` pub const FRAC_2_PI: f32 = 0.636619772367581343075535053490057448f32; // 0.636619746f32 ``` 2/π rust Constant std::f32::consts::LN_2 Constant std::f32::consts::LN\_2 ================================ ``` pub const LN_2: f32 = 0.693147180559945309417232121458176568f32; // 0.693147182f32 ``` ln(2) rust Constant std::f32::consts::LOG2_E Constant std::f32::consts::LOG2\_E ================================== ``` pub const LOG2_E: f32 = 1.44269504088896340735992468100189214f32; // 1.44269502f32 ``` log2(e) rust Struct std::boxed::Box Struct std::boxed::Box ====================== ``` pub struct Box<T, A = Global>(_, _)where    A: Allocator,    T: ?Sized; ``` A pointer type for heap allocation. See the [module-level documentation](index) for more. Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#204)### impl<T> Box<T, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#218)#### pub fn new(x: T) -> Box<T, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Allocates memory on the heap and then places `x` into it. This doesn’t actually allocate if `T` is zero-sized. ##### Examples ``` let five = Box::new(5); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#245)#### pub fn new\_uninit() -> Box<MaybeUninit<T>, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Constructs a new box with uninitialized contents. ##### Examples ``` #![feature(new_uninit)] let mut five = Box::<u32>::new_uninit(); let five = unsafe { // Deferred initialization: five.as_mut_ptr().write(5); five.assume_init() }; assert_eq!(*five, 5) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#271)#### pub fn new\_zeroed() -> Box<MaybeUninit<T>, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Constructs a new `Box` with uninitialized contents, with the memory being filled with `0` bytes. See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(new_uninit)] let zero = Box::<u32>::new_zeroed(); let zero = unsafe { zero.assume_init() }; assert_eq!(*zero, 0) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#286)1.33.0 · #### pub fn pin(x: T) -> Pin<Box<T, Global>> Notable traits for [Pin](../pin/struct.pin "struct std::pin::Pin")<P> ``` impl<P> Future for Pin<P>where     P: DerefMut,     <P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; ``` Constructs a new `Pin<Box<T>>`. If `T` does not implement [`Unpin`](../marker/trait.unpin "Unpin"), then `x` will be pinned in memory and unable to be moved. Constructing and pinning of the `Box` can also be done in two steps: `Box::pin(x)` does the same as `[Box::into\_pin](struct.box#method.into_pin "Box::into_pin")([Box::new](struct.box#method.new "Box::new")(x))`. Consider using [`into_pin`](struct.box#method.into_pin) if you already have a `Box<T>`, or if you want to construct a (pinned) `Box` in a different way than with [`Box::new`](struct.box#method.new "Box::new"). [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#307)#### pub fn try\_new(x: T) -> Result<Box<T, Global>, AllocError> 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Allocates memory on the heap then places `x` into it, returning an error if the allocation fails This doesn’t actually allocate if `T` is zero-sized. ##### Examples ``` #![feature(allocator_api)] let five = Box::try_new(5)?; ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#334)#### pub fn try\_new\_uninit() -> Result<Box<MaybeUninit<T>, Global>, AllocError> 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new box with uninitialized contents on the heap, returning an error if the allocation fails ##### Examples ``` #![feature(allocator_api, new_uninit)] let mut five = Box::<u32>::try_new_uninit()?; let five = unsafe { // Deferred initialization: five.as_mut_ptr().write(5); five.assume_init() }; assert_eq!(*five, 5); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#360)#### pub fn try\_new\_zeroed() -> Result<Box<MaybeUninit<T>, Global>, AllocError> 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new `Box` with uninitialized contents, with the memory being filled with `0` bytes on the heap See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(allocator_api, new_uninit)] let zero = Box::<u32>::try_new_zeroed()?; let zero = unsafe { zero.assume_init() }; assert_eq!(*zero, 0); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#365)### impl<T, A> Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#384-386)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn new\_in(x: T, alloc: A) -> Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Allocates memory in the given allocator then places `x` into it. This doesn’t actually allocate if `T` is zero-sized. ##### Examples ``` #![feature(allocator_api)] use std::alloc::System; let five = Box::new_in(5, System); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#413-416)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn try\_new\_in(x: T, alloc: A) -> Result<Box<T, A>, AllocError>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Allocates memory in the given allocator then places `x` into it, returning an error if the allocation fails This doesn’t actually allocate if `T` is zero-sized. ##### Examples ``` #![feature(allocator_api)] use std::alloc::System; let five = Box::try_new_in(5, System)?; ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#450-452)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn new\_uninit\_in(alloc: A) -> Box<MaybeUninit<T>, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new box with uninitialized contents in the provided allocator. ##### Examples ``` #![feature(allocator_api, new_uninit)] use std::alloc::System; let mut five = Box::<u32, _>::new_uninit_in(System); let five = unsafe { // Deferred initialization: five.as_mut_ptr().write(5); five.assume_init() }; assert_eq!(*five, 5) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#488-490)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn try\_new\_uninit\_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new box with uninitialized contents in the provided allocator, returning an error if the allocation fails ##### Examples ``` #![feature(allocator_api, new_uninit)] use std::alloc::System; let mut five = Box::<u32, _>::try_new_uninit_in(System)?; let five = unsafe { // Deferred initialization: five.as_mut_ptr().write(5); five.assume_init() }; assert_eq!(*five, 5); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#522-524)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn new\_zeroed\_in(alloc: A) -> Box<MaybeUninit<T>, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new `Box` with uninitialized contents, with the memory being filled with `0` bytes in the provided allocator. See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(allocator_api, new_uninit)] use std::alloc::System; let zero = Box::<u32, _>::new_zeroed_in(System); let zero = unsafe { zero.assume_init() }; assert_eq!(*zero, 0) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#560-562)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn try\_new\_zeroed\_in(alloc: A) -> Result<Box<MaybeUninit<T>, A>, AllocError>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new `Box` with uninitialized contents, with the memory being filled with `0` bytes in the provided allocator, returning an error if the allocation fails, See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(allocator_api, new_uninit)] use std::alloc::System; let zero = Box::<u32, _>::try_new_zeroed_in(System)?; let zero = unsafe { zero.assume_init() }; assert_eq!(*zero, 0); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#581-583)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn pin\_in(x: T, alloc: A) -> Pin<Box<T, A>>where A: 'static + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Notable traits for [Pin](../pin/struct.pin "struct std::pin::Pin")<P> ``` impl<P> Future for Pin<P>where     P: DerefMut,     <P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new `Pin<Box<T, A>>`. If `T` does not implement [`Unpin`](../marker/trait.unpin "Unpin"), then `x` will be pinned in memory and unable to be moved. Constructing and pinning of the `Box` can also be done in two steps: `Box::pin_in(x, alloc)` does the same as `[Box::into\_pin](struct.box#method.into_pin "Box::into_pin")([Box::new\_in](struct.box#method.new_in "Box::new_in")(x, alloc))`. Consider using [`into_pin`](struct.box#method.into_pin) if you already have a `Box<T, A>`, or if you want to construct a (pinned) `Box` in a different way than with [`Box::new_in`](struct.box#method.new_in "Box::new_in"). [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#593)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn into\_boxed\_slice(boxed: Box<T, A>) -> Box<[T], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`box_into_boxed_slice` [#71582](https://github.com/rust-lang/rust/issues/71582)) Converts a `Box<T>` into a `Box<[T]>` This conversion does not allocate on the heap and happens in place. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#612-614)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn into\_inner(boxed: Box<T, A>) -> T 🔬This is a nightly-only experimental API. (`box_into_inner` [#80437](https://github.com/rust-lang/rust/issues/80437)) Consumes the `Box`, returning the wrapped value. ##### Examples ``` #![feature(box_into_inner)] let c = Box::new(5); assert_eq!(Box::into_inner(c), 5); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#620)### impl<T> Box<[T], Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#644)#### pub fn new\_uninit\_slice(len: usize) -> Box<[MaybeUninit<T>], Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Constructs a new boxed slice with uninitialized contents. ##### Examples ``` #![feature(new_uninit)] let mut values = Box::<[u32]>::new_uninit_slice(3); let values = unsafe { // Deferred initialization: values[0].as_mut_ptr().write(1); values[1].as_mut_ptr().write(2); values[2].as_mut_ptr().write(3); values.assume_init() }; assert_eq!(*values, [1, 2, 3]) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#669)#### pub fn new\_zeroed\_slice(len: usize) -> Box<[MaybeUninit<T>], Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Constructs a new boxed slice with uninitialized contents, with the memory being filled with `0` bytes. See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(new_uninit)] let values = Box::<[u32]>::new_zeroed_slice(3); let values = unsafe { values.assume_init() }; assert_eq!(*values, [0, 0, 0]) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#695)#### pub fn try\_new\_uninit\_slice( len: usize) -> Result<Box<[MaybeUninit<T>], Global>, AllocError> 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new boxed slice with uninitialized contents. Returns an error if the allocation fails ##### Examples ``` #![feature(allocator_api, new_uninit)] let mut values = Box::<[u32]>::try_new_uninit_slice(3)?; let values = unsafe { // Deferred initialization: values[0].as_mut_ptr().write(1); values[1].as_mut_ptr().write(2); values[2].as_mut_ptr().write(3); values.assume_init() }; assert_eq!(*values, [1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#727)#### pub fn try\_new\_zeroed\_slice( len: usize) -> Result<Box<[MaybeUninit<T>], Global>, AllocError> 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new boxed slice with uninitialized contents, with the memory being filled with `0` bytes. Returns an error if the allocation fails See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(allocator_api, new_uninit)] let values = Box::<[u32]>::try_new_zeroed_slice(3)?; let values = unsafe { values.assume_init() }; assert_eq!(*values, [0, 0, 0]); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#739)### impl<T, A> Box<[T], A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#766)#### pub fn new\_uninit\_slice\_in(len: usize, alloc: A) -> Box<[MaybeUninit<T>], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new boxed slice with uninitialized contents in the provided allocator. ##### Examples ``` #![feature(allocator_api, new_uninit)] use std::alloc::System; let mut values = Box::<[u32], _>::new_uninit_slice_in(3, System); let values = unsafe { // Deferred initialization: values[0].as_mut_ptr().write(1); values[1].as_mut_ptr().write(2); values[2].as_mut_ptr().write(3); values.assume_init() }; assert_eq!(*values, [1, 2, 3]) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#794)#### pub fn new\_zeroed\_slice\_in(len: usize, alloc: A) -> Box<[MaybeUninit<T>], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new boxed slice with uninitialized contents in the provided allocator, with the memory being filled with `0` bytes. See [`MaybeUninit::zeroed`](../mem/union.maybeuninit#method.zeroed) for examples of correct and incorrect usage of this method. ##### Examples ``` #![feature(allocator_api, new_uninit)] use std::alloc::System; let values = Box::<[u32], _>::new_zeroed_slice_in(3, System); let values = unsafe { values.assume_init() }; assert_eq!(*values, [0, 0, 0]) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#799)### impl<T, A> Box<MaybeUninit<T>, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#831)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub unsafe fn assume\_init(self) -> Box<T, A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Converts to `Box<T, A>`. ##### Safety As with [`MaybeUninit::assume_init`](../mem/union.maybeuninit#method.assume_init), it is up to the caller to guarantee that the value really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior. ##### Examples ``` #![feature(new_uninit)] let mut five = Box::<u32>::new_uninit(); let five: Box<u32> = unsafe { // Deferred initialization: five.as_mut_ptr().write(5); five.assume_init() }; assert_eq!(*five, 5) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#866)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn write(boxed: Box<MaybeUninit<T>, A>, value: T) -> Box<T, A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Writes the value and converts to `Box<T, A>`. This method converts the box similarly to [`Box::assume_init`](struct.box#method.assume_init "Box::assume_init") but writes `value` into it before conversion thus guaranteeing safety. In some scenarios use of this method may improve performance because the compiler may be able to optimize copying from stack. ##### Examples ``` #![feature(new_uninit)] let big_box = Box::<[usize; 1024]>::new_uninit(); let mut array = [0; 1024]; for (i, place) in array.iter_mut().enumerate() { *place = i; } // The optimizer may be able to elide this copy, so previous code writes // to heap directly. let big_box = Box::write(big_box, array); for (i, x) in big_box.iter().enumerate() { assert_eq!(*x, i); } ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#874)### impl<T, A> Box<[MaybeUninit<T>], A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#907)#### pub unsafe fn assume\_init(self) -> Box<[T], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`new_uninit` [#63291](https://github.com/rust-lang/rust/issues/63291)) Converts to `Box<[T], A>`. ##### Safety As with [`MaybeUninit::assume_init`](../mem/union.maybeuninit#method.assume_init), it is up to the caller to guarantee that the values really are in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior. ##### Examples ``` #![feature(new_uninit)] let mut values = Box::<[u32]>::new_uninit_slice(3); let values = unsafe { // Deferred initialization: values[0].as_mut_ptr().write(1); values[1].as_mut_ptr().write(2); values[2].as_mut_ptr().write(3); values.assume_init() }; assert_eq!(*values, [1, 2, 3]) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#913)### impl<T> Box<T, Global>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#958)1.4.0 · #### pub unsafe fn from\_raw(raw: \*mut T) -> Box<T, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Constructs a box from a raw pointer. After calling this function, the raw pointer is owned by the resulting `Box`. Specifically, the `Box` destructor will call the destructor of `T` and free the allocated memory. For this to be safe, the memory must have been allocated in accordance with the [memory layout](index#memory-layout) used by `Box` . ##### Safety This function is unsafe because improper use may lead to memory problems. For example, a double-free may occur if the function is called twice on the same raw pointer. The safety conditions are described in the [memory layout](index#memory-layout) section. ##### Examples Recreate a `Box` which was previously converted to a raw pointer using [`Box::into_raw`](struct.box#method.into_raw "Box::into_raw"): ``` let x = Box::new(5); let ptr = Box::into_raw(x); let x = unsafe { Box::from_raw(ptr) }; ``` Manually create a `Box` from scratch by using the global allocator: ``` use std::alloc::{alloc, Layout}; unsafe { let ptr = alloc(Layout::new::<i32>()) as *mut i32; // In general .write is required to avoid attempting to destruct // the (uninitialized) previous contents of `ptr`, though for this // simple example `*ptr = 5` would have worked as well. ptr.write(5); let x = Box::from_raw(ptr); } ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#963)### impl<T, A> Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1014)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub unsafe fn from\_raw\_in(raw: \*mut T, alloc: A) -> Box<T, A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a box from a raw pointer in the given allocator. After calling this function, the raw pointer is owned by the resulting `Box`. Specifically, the `Box` destructor will call the destructor of `T` and free the allocated memory. For this to be safe, the memory must have been allocated in accordance with the [memory layout](index#memory-layout) used by `Box` . ##### Safety This function is unsafe because improper use may lead to memory problems. For example, a double-free may occur if the function is called twice on the same raw pointer. ##### Examples Recreate a `Box` which was previously converted to a raw pointer using [`Box::into_raw_with_allocator`](struct.box#method.into_raw_with_allocator "Box::into_raw_with_allocator"): ``` #![feature(allocator_api)] use std::alloc::System; let x = Box::new_in(5, System); let (ptr, alloc) = Box::into_raw_with_allocator(x); let x = unsafe { Box::from_raw_in(ptr, alloc) }; ``` Manually create a `Box` from scratch by using the system allocator: ``` #![feature(allocator_api, slice_ptr_get)] use std::alloc::{Allocator, Layout, System}; unsafe { let ptr = System.allocate(Layout::new::<i32>())?.as_mut_ptr() as *mut i32; // In general .write is required to avoid attempting to destruct // the (uninitialized) previous contents of `ptr`, though for this // simple example `*ptr = 5` would have worked as well. ptr.write(5); let x = Box::from_raw_in(ptr, System); } ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1059)1.4.0 · #### pub fn into\_raw(b: Box<T, A>) -> \*mut T Consumes the `Box`, returning a wrapped raw pointer. The pointer will be properly aligned and non-null. After calling this function, the caller is responsible for the memory previously managed by the `Box`. In particular, the caller should properly destroy `T` and release the memory, taking into account the [memory layout](index#memory-layout) used by `Box`. The easiest way to do this is to convert the raw pointer back into a `Box` with the [`Box::from_raw`](struct.box#method.from_raw "Box::from_raw") function, allowing the `Box` destructor to perform the cleanup. Note: this is an associated function, which means that you have to call it as `Box::into_raw(b)` instead of `b.into_raw()`. This is so that there is no conflict with a method on the inner type. ##### Examples Converting the raw pointer back into a `Box` with [`Box::from_raw`](struct.box#method.from_raw "Box::from_raw") for automatic cleanup: ``` let x = Box::new(String::from("Hello")); let ptr = Box::into_raw(x); let x = unsafe { Box::from_raw(ptr) }; ``` Manual cleanup by explicitly running the destructor and deallocating the memory: ``` use std::alloc::{dealloc, Layout}; use std::ptr; let x = Box::new(String::from("Hello")); let p = Box::into_raw(x); unsafe { ptr::drop_in_place(p); dealloc(p as *mut u8, Layout::new::<String>()); } ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1112)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn into\_raw\_with\_allocator(b: Box<T, A>) -> (\*mut T, A) 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Consumes the `Box`, returning a wrapped raw pointer and the allocator. The pointer will be properly aligned and non-null. After calling this function, the caller is responsible for the memory previously managed by the `Box`. In particular, the caller should properly destroy `T` and release the memory, taking into account the [memory layout](index#memory-layout) used by `Box`. The easiest way to do this is to convert the raw pointer back into a `Box` with the [`Box::from_raw_in`](struct.box#method.from_raw_in "Box::from_raw_in") function, allowing the `Box` destructor to perform the cleanup. Note: this is an associated function, which means that you have to call it as `Box::into_raw_with_allocator(b)` instead of `b.into_raw_with_allocator()`. This is so that there is no conflict with a method on the inner type. ##### Examples Converting the raw pointer back into a `Box` with [`Box::from_raw_in`](struct.box#method.from_raw_in "Box::from_raw_in") for automatic cleanup: ``` #![feature(allocator_api)] use std::alloc::System; let x = Box::new_in(String::from("Hello"), System); let (ptr, alloc) = Box::into_raw_with_allocator(x); let x = unsafe { Box::from_raw_in(ptr, alloc) }; ``` Manual cleanup by explicitly running the destructor and deallocating the memory: ``` #![feature(allocator_api)] use std::alloc::{Allocator, Layout, System}; use std::ptr::{self, NonNull}; let x = Box::new_in(String::from("Hello"), System); let (ptr, alloc) = Box::into_raw_with_allocator(x); unsafe { ptr::drop_in_place(ptr); let non_null = NonNull::new_unchecked(ptr); alloc.deallocate(non_null.cast(), Layout::new::<String>()); } ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1143)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### pub fn allocator(b: &Box<T, A>) -> &A 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Returns a reference to the underlying allocator. Note: this is an associated function, which means that you have to call it as `Box::allocator(&b)` instead of `b.allocator()`. This is so that there is no conflict with a method on the inner type. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1185-1187)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box")) · #### pub fn leak<'a>(b: Box<T, A>) -> &'a mut Twhere A: 'a, Consumes and leaks the `Box`, returning a mutable reference, `&'a mut T`. Note that the type `T` must outlive the chosen lifetime `'a`. If the type has only static references, or none at all, then this may be chosen to be `'static`. This function is mainly useful for data that lives for the remainder of the program’s life. Dropping the returned reference will cause a memory leak. If this is not acceptable, the reference should first be wrapped with the [`Box::from_raw`](struct.box#method.from_raw "Box::from_raw") function producing a `Box`. This `Box` can then be dropped which will properly destroy `T` and release the allocated memory. Note: this is an associated function, which means that you have to call it as `Box::leak(b)` instead of `b.leak()`. This is so that there is no conflict with a method on the inner type. ##### Examples Simple usage: ``` let x = Box::new(41); let static_ref: &'static mut usize = Box::leak(x); *static_ref += 1; assert_eq!(*static_ref, 42); ``` Unsized data: ``` let x = vec![1, 2, 3].into_boxed_slice(); let static_ref = Box::leak(x); static_ref[0] = 4; assert_eq!(*static_ref, [4, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1224-1226)1.63.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box")) · #### pub fn into\_pin(boxed: Box<T, A>) -> Pin<Box<T, A>>where A: 'static, Notable traits for [Pin](../pin/struct.pin "struct std::pin::Pin")<P> ``` impl<P> Future for Pin<P>where     P: DerefMut,     <P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; ``` Converts a `Box<T>` into a `Pin<Box<T>>`. If `T` does not implement [`Unpin`](../marker/trait.unpin "Unpin"), then `*boxed` will be pinned in memory and unable to be moved. This conversion does not allocate on the heap and happens in place. This is also available via [`From`](../convert/trait.from "From"). Constructing and pinning a `Box` with `Box::into_pin([Box::new](struct.box#method.new "Box::new")(x))` can also be written more concisely using `[Box::pin](struct.box#method.pin "Box::pin")(x)`. This `into_pin` method is useful if you already have a `Box<T>`, or you are constructing a (pinned) `Box` in a different way than with [`Box::new`](struct.box#method.new "Box::new"). ##### Notes It’s not recommended that crates add an impl like `From<Box<T>> for Pin<T>`, as it’ll introduce an ambiguity when calling `Pin::from`. A demonstration of such a poor impl is shown below. ⓘ ``` struct Foo; // A type defined in this crate. impl From<Box<()>> for Pin<Foo> { fn from(_: Box<()>) -> Pin<Foo> { Pin::new(Foo) } } let foo = Box::new(()); let bar = Pin::from(foo); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1647)### impl<A> Box<dyn Any + 'static, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1667)#### pub fn downcast<T>(self) -> Result<Box<T, A>, Box<dyn Any + 'static, A>>where T: [Any](../any/trait.any "trait std::any::Any"), Attempt to downcast the box to a concrete type. ##### Examples ``` use std::any::Any; fn print_if_string(value: Box<dyn Any>) { if let Ok(string) = value.downcast::<String>() { println!("String ({}): {}", string.len(), string); } } let my_string = "Hello World".to_string(); print_if_string(Box::new(my_string)); print_if_string(Box::new(0i8)); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1697)#### pub unsafe fn downcast\_unchecked<T>(self) -> Box<T, A>where T: [Any](../any/trait.any "trait std::any::Any"), Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Downcasts the box to a concrete type. For a safe alternative see [`downcast`](struct.box#method.downcast). ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1706)### impl<A> Box<dyn Any + Send + 'static, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1726)#### pub fn downcast<T>(self) -> Result<Box<T, A>, Box<dyn Any + Send + 'static, A>>where T: [Any](../any/trait.any "trait std::any::Any"), Attempt to downcast the box to a concrete type. ##### Examples ``` use std::any::Any; fn print_if_string(value: Box<dyn Any + Send>) { if let Ok(string) = value.downcast::<String>() { println!("String ({}): {}", string.len(), string); } } let my_string = "Hello World".to_string(); print_if_string(Box::new(my_string)); print_if_string(Box::new(0i8)); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1756)#### pub unsafe fn downcast\_unchecked<T>(self) -> Box<T, A>where T: [Any](../any/trait.any "trait std::any::Any"), Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Downcasts the box to a concrete type. For a safe alternative see [`downcast`](struct.box#method.downcast). ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any + Send> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1765)### impl<A> Box<dyn Any + Send + Sync + 'static, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1785)1.51.0 · #### pub fn downcast<T>( self) -> Result<Box<T, A>, Box<dyn Any + Send + Sync + 'static, A>>where T: [Any](../any/trait.any "trait std::any::Any"), Attempt to downcast the box to a concrete type. ##### Examples ``` use std::any::Any; fn print_if_string(value: Box<dyn Any + Send + Sync>) { if let Ok(string) = value.downcast::<String>() { println!("String ({}): {}", string.len(), string); } } let my_string = "Hello World".to_string(); print_if_string(Box::new(my_string)); print_if_string(Box::new(0i8)); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1815)#### pub unsafe fn downcast\_unchecked<T>(self) -> Box<T, A>where T: [Any](../any/trait.any "trait std::any::Any"), Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Downcasts the box to a concrete type. For a safe alternative see [`downcast`](struct.box#method.downcast). ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any + Send + Sync> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#384-389)1.64.0 · ### impl<T: AsFd> AsFd for Box<T> [source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#386-388)#### fn as\_fd(&self) -> BorrowedFd<'\_> Available on **Unix** only.Borrows the file descriptor. [Read more](../os/unix/io/trait.asfd#tymethod.as_fd) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2011)1.5.0 · ### impl<T, A> AsMut<T> for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2012)#### fn as\_mut(&mut self) -> &mut T Converts this type into a mutable reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/os/fd/raw.rs.html#254-259)1.63.0 · ### impl<T: AsRawFd> AsRawFd for Box<T> [source](https://doc.rust-lang.org/src/std/os/fd/raw.rs.html#256-258)#### fn as\_raw\_fd(&self) -> RawFd Available on **Unix** only.Extracts the raw file descriptor. [Read more](../os/unix/io/trait.asrawfd#tymethod.as_raw_fd) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2004)1.5.0 · ### impl<T, A> AsRef<T> for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2005)#### fn as\_ref(&self) -> &T Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2082)### impl<S> AsyncIterator for Box<S, Global>where S: [AsyncIterator](../async_iter/trait.asynciterator "trait std::async_iter::AsyncIterator") + [Unpin](../marker/trait.unpin "trait std::marker::Unpin") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Item = <S as AsyncIterator>::Item 🔬This is a nightly-only experimental API. (`async_iterator` [#79024](https://github.com/rust-lang/rust/issues/79024)) The type of items yielded by the async iterator. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2085)#### fn poll\_next( self: Pin<&mut Box<S, Global>>, cx: &mut Context<'\_>) -> Poll<Option<<Box<S, Global> as AsyncIterator>::Item>> 🔬This is a nightly-only experimental API. (`async_iterator` [#79024](https://github.com/rust-lang/rust/issues/79024)) Attempt to pull out the next value of this async iterator, registering the current task for wakeup if the value is not yet available, and returning `None` if the async iterator is exhausted. [Read more](../async_iter/trait.asynciterator#tymethod.poll_next) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2089)#### fn size\_hint(&self) -> (usize, Option<usize>) 🔬This is a nightly-only experimental API. (`async_iterator` [#79024](https://github.com/rust-lang/rust/issues/79024)) Returns the bounds on the remaining length of the async iterator. [Read more](../async_iter/trait.asynciterator#method.size_hint) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1990)1.1.0 · ### impl<T, A> Borrow<T> for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1991)#### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1997)1.1.0 · ### impl<T, A> BorrowMut<T> for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1998)#### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#202-222)### impl<B: BufRead + ?Sized> BufRead for Box<B> [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#204-206)#### fn fill\_buf(&mut self) -> Result<&[u8]> Returns the contents of the internal buffer, filling it with more data from the inner reader if it is empty. [Read more](../io/trait.bufread#tymethod.fill_buf) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#209-211)#### fn consume(&mut self, amt: usize) Tells this buffer that `amt` bytes have been consumed from the buffer, so they should no longer be returned in calls to `read`. [Read more](../io/trait.bufread#tymethod.consume) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#214-216)#### fn read\_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> Read all bytes into `buf` until the delimiter `byte` or EOF is reached. [Read more](../io/trait.bufread#method.read_until) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#219-221)#### fn read\_line(&mut self, buf: &mut String) -> Result<usize> Read all bytes until a newline (the `0xA` byte) is reached, and append them to the provided buffer. You do not need to clear the buffer before appending. [Read more](../io/trait.bufread#method.read_line) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2073-2075)#### fn has\_data\_left(&mut self) -> Result<bool> 🔬This is a nightly-only experimental API. (`buf_read_has_data_left` [#86423](https://github.com/rust-lang/rust/issues/86423)) Check if the underlying `Read` has any data left to be read. [Read more](../io/trait.bufread#method.has_data_left) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2234-2239)#### fn split(self, byte: u8) -> Split<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Split](../io/struct.split "struct std::io::Split")<B> ``` impl<B: BufRead> Iterator for Split<B> type Item = Result<Vec<u8>>; ``` Returns an iterator over the contents of this reader split on the byte `byte`. [Read more](../io/trait.bufread#method.split) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2271-2276)#### fn lines(self) -> Lines<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Lines](../io/struct.lines "struct std::io::Lines")<B> ``` impl<B: BufRead> Iterator for Lines<B> type Item = Result<String>; ``` Returns an iterator over the lines of this reader. [Read more](../io/trait.bufread#method.lines) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1974)1.3.0 · ### impl<T, A> Clone for Box<[T], A>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1975)#### fn clone(&self) -> Box<[T], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1980)#### fn clone\_from(&mut self, other: &Box<[T], A>) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#821)1.29.0 · ### impl Clone for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#823)#### fn clone(&self) -> Box<CStr, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1027-1032)1.29.0 · ### impl Clone for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1029-1031)#### fn clone(&self) -> Self Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/path.rs.html#1629-1634)1.29.0 · ### impl Clone for Box<Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1631-1633)#### fn clone(&self) -> Self Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1278)### impl<T, A> Clone for Box<T, A>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1294)#### fn clone(&self) -> Box<T, A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns a new box with a `clone()` of this box’s contents. ##### Examples ``` let x = Box::new(5); let y = x.clone(); // The value is the same assert_eq!(x, y); // But they are unique objects assert_ne!(&*x as *const i32, &*y as *const i32); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1321)#### fn clone\_from(&mut self, source: &Box<T, A>) Copies `source`’s contents into `self` without creating a new allocation. ##### Examples ``` let x = Box::new(5); let mut y = Box::new(10); let yp: *const i32 = &*y; y.clone_from(&x); // The value is the same assert_eq!(x, y); // And no allocation occurred assert_eq!(yp, &*y); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1328)1.3.0 · ### impl Clone for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1329)#### fn clone(&self) -> Box<str, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1833)### impl<T, A> Debug for Box<T, A>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1834)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1255)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for Box<[T], Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1256)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> Box<[T], Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#912)1.17.0 · ### impl Default for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#913)#### fn default() -> Box<CStr, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1114-1120)1.17.0 · ### impl Default for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1116-1119)#### fn default() -> Box<OsStr> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1244)### impl<T> Default for Box<T, Global>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1246)#### fn default() -> Box<T, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Creates a `Box<T>`, with the `Default` value for T. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1265)1.17.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls")) · ### impl Default for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1266)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> Box<str, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1851)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · ### impl<T, A> Deref for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1854)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### fn deref(&self) -> &T Dereferences the value. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1861)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · ### impl<T, A> DerefMut for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1862)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### fn deref\_mut(&mut self) -> &mut T Mutably dereferences the value. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1826)### impl<T, A> Display for Box<T, A>where T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1827)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1914)### impl<I, A> DoubleEndedIterator for Box<I, A>where I: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1915)#### fn next\_back(&mut self) -> Option<<I as Iterator>::Item> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1918)#### fn nth\_back(&mut self, n: usize) -> Option<<I as Iterator>::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1236)### impl<T, A> Drop for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1237)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2379)1.8.0 · ### impl<T> Error for Box<T, Global>where T: [Error](../error/trait.error "trait std::error::Error"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2381)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2386)#### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2390)#### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1923)### impl<I, A> ExactSizeIterator for Box<I, A>where I: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1924)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1927)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2107)1.45.0 · ### impl Extend<Box<str, Global>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2108)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [Box](struct.box "struct std::boxed::Box")<[str](../primitive.str), [Global](../alloc/struct.global "struct std::alloc::Global")>>, Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#371)#### fn extend\_one(&mut self, item: A) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1952)1.35.0 · ### impl<Args, F, A> Fn<Args> for Box<F, A>where F: [Fn](../ops/trait.fn "trait std::ops::Fn")<Args> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1953)#### extern "rust-call" fn call( &self, args: Args) -> <Box<F, A> as FnOnce<Args>>::Output Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1945)1.35.0 · ### impl<Args, F, A> FnMut<Args> for Box<F, A>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")<Args> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1946)#### extern "rust-call" fn call\_mut( &mut self, args: Args) -> <Box<F, A> as FnOnce<Args>>::Output Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1936)1.35.0 · ### impl<Args, F, A> FnOnce<Args> for Box<F, A>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")<Args> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Output = <F as FnOnce<Args>>::Output The returned type after the call operator is used. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1939)#### extern "rust-call" fn call\_once( self, args: Args) -> <Box<F, A> as FnOnce<Args>>::Output Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1484)1.17.0 · ### impl<T> From<&[T]> for Box<[T], Global>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1498)#### fn from(slice: &[T]) -> Box<[T], Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `&[T]` into a `Box<[T]>` This conversion allocates on the heap and performs a copy of `slice` and its contents. ##### 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:?}"); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#765)1.17.0 · ### impl From<&CStr> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#768)#### fn from(s: &CStr) -> Box<CStr, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `&CStr` into a `Box<CStr>`, by copying the contents into a newly allocated [`Box`](struct.box "Box"). [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#985-992)1.17.0 · ### impl From<&OsStr> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#988-991)#### fn from(s: &OsStr) -> Box<OsStr> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Copies the string into a newly allocated `[Box](struct.box "Box")<[OsStr](../ffi/struct.osstr "OsStr")>`. [source](https://doc.rust-lang.org/src/std/path.rs.html#1580-1589)1.17.0 · ### impl From<&Path> for Box<Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1584-1588)#### fn from(path: &Path) -> Box<Path> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Creates a boxed [`Path`](../path/struct.path "Path") from a reference. This will allocate and clone `path` to it. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2312)1.6.0 · ### impl From<&str> for Box<dyn Error + 'static, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2327)#### fn from(err: &str) -> Box<dyn Error + 'static, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`str`](../primitive.str) into a box of dyn [`Error`](../error/trait.error "Error"). ##### Examples ``` use std::error::Error; use std::mem; let a_str_error = "a str error"; let a_boxed_error = Box::<dyn Error>::from(a_str_error); assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error)) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2287)### impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2304)#### fn from(err: &str) -> Box<dyn Error + Send + Sync + 'a, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`str`](../primitive.str) into a box of dyn [`Error`](../error/trait.error "Error") + [`Send`](../marker/trait.send "Send") + [`Sync`](../marker/trait.sync "Sync"). ##### Examples ``` use std::error::Error; use std::mem; let a_str_error = "a str error"; let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_str_error); assert!( mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error)) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1528)1.17.0 · ### impl From<&str> for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1541)#### fn from(s: &str) -> Box<str, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 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}"); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1608)1.45.0 · ### impl<T, const N: usize> From<[T; N]> for Box<[T], Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1619)#### fn from(array: [T; N]) -> Box<[T], Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 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:?}"); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3064)1.18.0 · ### impl<T, A> From<Box<[T], A>> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3074)#### fn from(s: Box<[T], A>) -> Vec<T, A> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Convert a boxed slice into a vector by transferring ownership of the existing heap allocation. ##### Examples ``` let b: Box<[i32]> = vec![1, 2, 3].into_boxed_slice(); assert_eq!(Vec::from(b), vec![1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#788)1.18.0 · ### impl From<Box<CStr, Global>> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#791)#### fn from(s: Box<CStr, Global>) -> CString Converts a `[Box](struct.box "Box")<[CStr](../ffi/struct.cstr "CStr")>` into a [`CString`](../ffi/struct.cstring "CString") without copying or allocating. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1008-1015)1.18.0 · ### impl From<Box<OsStr, Global>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1012-1014)#### fn from(boxed: Box<OsStr>) -> OsString Converts a `[Box](struct.box "Box")<[OsStr](../ffi/struct.osstr "OsStr")>` into an [`OsString`](../ffi/struct.osstring "OsString") without copying or allocating. [source](https://doc.rust-lang.org/src/std/path.rs.html#1606-1614)1.18.0 · ### impl From<Box<Path, Global>> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#1611-1613)#### fn from(boxed: Box<Path>) -> PathBuf Converts a `[Box](struct.box "Box")<[Path](../path/struct.path "Path")>` into a [`PathBuf`](../path/struct.pathbuf "PathBuf"). This conversion does not allocate or copy memory. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1462)1.33.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box")) · ### impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1477)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · #### fn from(boxed: Box<T, A>) -> Pin<Box<T, A>> Notable traits for [Pin](../pin/struct.pin "struct std::pin::Pin")<P> ``` impl<P> Future for Pin<P>where     P: DerefMut,     <P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; ``` Converts a `Box<T>` into a `Pin<Box<T>>`. If `T` does not implement [`Unpin`](../marker/trait.unpin "Unpin"), then `*boxed` will be pinned in memory and unable to be moved. This conversion does not allocate on the heap and happens in place. This is also available via [`Box::into_pin`](struct.box#method.into_pin "Box::into_pin"). Constructing and pinning a `Box` with `<Pin<Box<T>>>::from([Box::new](struct.box#method.new "Box::new")(x))` can also be written more concisely using `[Box::pin](struct.box#method.pin "Box::pin")(x)`. This `From` implementation is useful if you already have a `Box<T>`, or you are constructing a (pinned) `Box` in a different way than with [`Box::new`](struct.box#method.new "Box::new"). [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2541)1.21.0 · ### impl<T> From<Box<T, Global>> for Arc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2553)#### fn from(v: Box<T, Global>) -> Arc<T> Move a boxed object to a new, reference-counted allocation. ##### Example ``` let unique: Box<str> = Box::from("eggplant"); let shared: Arc<str> = Arc::from(unique); assert_eq!("eggplant", &shared[..]); ``` [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1937)1.21.0 · ### impl<T> From<Box<T, Global>> for Rc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1949)#### fn from(v: Box<T, Global>) -> Rc<T> Move a boxed object to a new, reference counted, allocation. ##### Example ``` let original: Box<i32> = Box::new(1); let shared: Rc<i32> = Rc::from(original); assert_eq!(1, *shared); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1582)1.19.0 · ### impl<A> From<Box<str, A>> for Box<[u8], A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1600)#### fn from(s: Box<str, A>) -> Box<[u8], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 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); ``` [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2658)1.18.0 · ### impl From<Box<str, Global>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2673)#### fn from(s: Box<str, Global>) -> String Converts the given boxed `str` slice to a [`String`](../string/struct.string "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) ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#829)1.20.0 · ### impl From<CString> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#832)#### fn from(s: CString) -> Box<CStr, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`CString`](../ffi/struct.cstring "CString") into a `[Box](struct.box "Box")<[CStr](../ffi/struct.cstr "CStr")>` without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1510)1.45.0 · ### impl<T> From<Cow<'\_, [T]>> for Box<[T], Global>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1518)#### fn from(cow: Cow<'\_, [T]>) -> Box<[T], Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'_, [T]>` into a `Box<[T]>` When `cow` is the `Cow::Borrowed` variant, this conversion allocates on the heap and copies the underlying slice. Otherwise, it will try to reuse the owned `Vec`’s allocation. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#775)1.45.0 · ### impl From<Cow<'\_, CStr>> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#779)#### fn from(cow: Cow<'\_, CStr>) -> Box<CStr, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'a, CStr>` into a `Box<CStr>`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#995-1005)1.45.0 · ### impl From<Cow<'\_, OsStr>> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#999-1004)#### fn from(cow: Cow<'\_, OsStr>) -> Box<OsStr> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'a, OsStr>` into a `[Box](struct.box "Box")<[OsStr](../ffi/struct.osstr "OsStr")>`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/path.rs.html#1592-1603)1.45.0 · ### impl From<Cow<'\_, Path>> for Box<Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1597-1602)#### fn from(cow: Cow<'\_, Path>) -> Box<Path> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Creates a boxed [`Path`](../path/struct.path "Path") from a clone-on-write pointer. Converting from a `Cow::Owned` does not clone or allocate. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1548)1.45.0 · ### impl From<Cow<'\_, str>> for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1573)#### fn from(cow: Cow<'\_, str>) -> Box<str, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'_, str>` into a `Box<str>` When `cow` is the `Cow::Borrowed` variant, this conversion allocates on the heap and copies the underlying `str`. Otherwise, it will try to reuse the owned `String`’s allocation. ##### Examples ``` use std::borrow::Cow; let unboxed = Cow::Borrowed("hello"); let boxed: Box<str> = Box::from(unboxed); println!("{boxed}"); ``` ``` let unboxed = Cow::Owned("hello".to_string()); let boxed: Box<str> = Box::from(unboxed); println!("{boxed}"); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2358)1.22.0 · ### impl<'a> From<Cow<'a, str>> for Box<dyn Error + 'static, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2372)#### fn from(err: Cow<'a, str>) -> Box<dyn Error + 'static, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`Cow`](../borrow/enum.cow "Cow") into a box of dyn [`Error`](../error/trait.error "Error"). ##### 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>::from(a_cow_str_error); assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error)) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2335)1.22.0 · ### impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2350)#### fn from(err: Cow<'b, str>) -> Box<dyn Error + Send + Sync + 'a, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`Cow`](../borrow/enum.cow "Cow") into a box of dyn [`Error`](../error/trait.error "Error") + [`Send`](../marker/trait.send "Send") + [`Sync`](../marker/trait.sync "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)) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2145)### impl<'a, E> From<E> for Box<dyn Error + 'a, Global>where E: 'a + [Error](../error/trait.error "trait std::error::Error"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2171)#### fn from(err: E) -> Box<dyn Error + 'a, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a type of [`Error`](../error/trait.error "Error") into a box of dyn [`Error`](../error/trait.error "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)) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2179)### impl<'a, E> From<E> for Box<dyn Error + Send + Sync + 'a, Global>where E: 'a + [Error](../error/trait.error "trait std::error::Error") + [Send](../marker/trait.send "trait std::marker::Send") + [Sync](../marker/trait.sync "trait std::marker::Sync"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2211)#### fn from(err: E) -> Box<dyn Error + Send + Sync + 'a, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a type of [`Error`](../error/trait.error "Error") + [`Send`](../marker/trait.send "Send") + [`Sync`](../marker/trait.sync "Sync") into a box of dyn [`Error`](../error/trait.error "Error") + [`Send`](../marker/trait.send "Send") + [`Sync`](../marker/trait.sync "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)) ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1018-1024)1.20.0 · ### impl From<OsString> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1021-1023)#### fn from(s: OsString) -> Box<OsStr> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts an [`OsString`](../ffi/struct.osstring "OsString") into a `[Box](struct.box "Box")<[OsStr](../ffi/struct.osstr "OsStr")>` without copying or allocating. [source](https://doc.rust-lang.org/src/std/path.rs.html#1617-1626)1.20.0 · ### impl From<PathBuf> for Box<Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1623-1625)#### fn from(p: PathBuf) -> Box<Path> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`PathBuf`](../path/struct.pathbuf "PathBuf") into a `[Box](struct.box "Box")<[Path](../path/struct.path "Path")>`. This conversion currently should not allocate memory, but this behavior is not guaranteed on all platforms or in all future versions. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2264)1.6.0 · ### impl From<String> for Box<dyn Error + 'static, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2277)#### fn from(str\_err: String) -> Box<dyn Error + 'static, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`String`](../string/struct.string "String") into a box of dyn [`Error`](../error/trait.error "Error"). ##### Examples ``` use std::error::Error; use std::mem; let a_string_error = "a string error".to_string(); let a_boxed_error = Box::<dyn Error>::from(a_string_error); assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error)) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2219)### impl From<String> for Box<dyn Error + Send + Sync + 'static, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2234)#### fn from(err: String) -> Box<dyn Error + Send + Sync + 'static, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`String`](../string/struct.string "String") into a box of dyn [`Error`](../error/trait.error "Error") + [`Send`](../marker/trait.send "Send") + [`Sync`](../marker/trait.sync "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)) ``` [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2680)1.20.0 · ### impl From<String> for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2694)#### fn from(s: String) -> Box<str, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts the given [`String`](../string/struct.string "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) ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1441)1.6.0 · ### impl<T> From<T> for Box<T, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1455)#### fn from(t: T) -> Box<T, Global> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `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); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3083)1.20.0 · ### impl<T, A> From<Vec<T, A>> for Box<[T], A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3094)#### fn from(v: Vec<T, A>) -> Box<[T], A> Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Convert a vector into a boxed slice. If `v` has excess capacity, its items will be moved into a newly-allocated buffer with exactly the right capacity. ##### Examples ``` assert_eq!(Box::from(vec![1, 2, 3]), vec![1, 2, 3].into_boxed_slice()); ``` [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2025)1.45.0 · ### impl FromIterator<Box<str, Global>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2026)#### fn from\_iter<I>(iter: I) -> Stringwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [Box](struct.box "struct std::boxed::Box")<[str](../primitive.str), [Global](../alloc/struct.global "struct std::alloc::Global")>>, Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1966)1.32.0 · ### impl<I> FromIterator<I> for Box<[I], Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1967)#### fn from\_iter<T>(iter: T) -> Box<[I], Global>where T: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = I>, Notable traits for [Box](struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2070)1.36.0 · ### impl<F, A> Future for Box<F, A>where F: [Future](../future/trait.future "trait std::future::Future") + [Unpin](../marker/trait.unpin "trait std::marker::Unpin") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, #### type Output = <F as Future>::Output The type of value produced on completion. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2076)#### fn poll( self: Pin<&mut Box<F, A>>, cx: &mut Context<'\_>) -> Poll<<Box<F, A> as Future>::Output> Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. [Read more](../future/trait.future#tymethod.poll) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2044)### impl<G, R, A> Generator<R> for Box<G, A>where G: [Generator](../ops/trait.generator "trait std::ops::Generator")<R> + [Unpin](../marker/trait.unpin "trait std::marker::Unpin") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, #### type Yield = <G as Generator<R>>::Yield 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The type of value this generator yields. [Read more](../ops/trait.generator#associatedtype.Yield) #### type Return = <G as Generator<R>>::Return 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The type of value this generator returns. [Read more](../ops/trait.generator#associatedtype.Return) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2051)#### fn resume( self: Pin<&mut Box<G, A>>, arg: R) -> GeneratorState<<Box<G, A> as Generator<R>>::Yield, <Box<G, A> as Generator<R>>::Return> 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) Resumes the execution of this generator. [Read more](../ops/trait.generator#tymethod.resume) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2057)### impl<G, R, A> Generator<R> for Pin<Box<G, A>>where G: [Generator](../ops/trait.generator "trait std::ops::Generator")<R> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, #### type Yield = <G as Generator<R>>::Yield 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The type of value this generator yields. [Read more](../ops/trait.generator#associatedtype.Yield) #### type Return = <G as Generator<R>>::Return 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The type of value this generator returns. [Read more](../ops/trait.generator#associatedtype.Return) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2064)#### fn resume( self: Pin<&mut Pin<Box<G, A>>>, arg: R) -> GeneratorState<<Pin<Box<G, A>> as Generator<R>>::Yield, <Pin<Box<G, A>> as Generator<R>>::Return> 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) Resumes the execution of this generator. [Read more](../ops/trait.generator#tymethod.resume) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1381)### impl<T, A> Hash for Box<T, A>where T: [Hash](../hash/trait.hash "trait std::hash::Hash") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1382)#### fn hash<H>(&self, state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1388)1.22.0 · ### impl<T, A> Hasher for Box<T, A>where T: [Hasher](../hash/trait.hasher "trait std::hash::Hasher") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1389)#### fn finish(&self) -> u64 Returns the hash value for the values written so far. [Read more](../hash/trait.hasher#tymethod.finish) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1392)#### fn write(&mut self, bytes: &[u8]) Writes some data into this `Hasher`. [Read more](../hash/trait.hasher#tymethod.write) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1395)#### fn write\_u8(&mut self, i: u8) Writes a single `u8` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1398)#### fn write\_u16(&mut self, i: u16) Writes a single `u16` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1401)#### fn write\_u32(&mut self, i: u32) Writes a single `u32` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1404)#### fn write\_u64(&mut self, i: u64) Writes a single `u64` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1407)#### fn write\_u128(&mut self, i: u128) Writes a single `u128` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1410)#### fn write\_usize(&mut self, i: usize) Writes a single `usize` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1413)#### fn write\_i8(&mut self, i: i8) Writes a single `i8` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1416)#### fn write\_i16(&mut self, i: i16) Writes a single `i16` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1419)#### fn write\_i32(&mut self, i: i32) Writes a single `i32` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1422)#### fn write\_i64(&mut self, i: i64) Writes a single `i64` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1425)#### fn write\_i128(&mut self, i: i128) Writes a single `i128` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1428)#### fn write\_isize(&mut self, i: isize) Writes a single `isize` into this hasher. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1431)#### fn write\_length\_prefix(&mut self, len: usize) 🔬This is a nightly-only experimental API. (`hasher_prefixfree_extras` [#96762](https://github.com/rust-lang/rust/issues/96762)) Writes a length prefix into this hasher, as part of being prefix-free. [Read more](../hash/trait.hasher#method.write_length_prefix) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1434)#### fn write\_str(&mut self, s: &str) 🔬This is a nightly-only experimental API. (`hasher_prefixfree_extras` [#96762](https://github.com/rust-lang/rust/issues/96762)) Writes a single `str` into this hasher. [Read more](../hash/trait.hasher#method.write_str) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1871)### impl<I, A> Iterator for Box<I, A>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1873)#### fn next(&mut self) -> Option<<I as Iterator>::Item> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1876)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1879)#### fn nth(&mut self, n: usize) -> Option<<I as Iterator>::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1882)#### fn last(self) -> Option<<I as Iterator>::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1371)### impl<T, A> Ord for Box<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1373)#### fn cmp(&self, other: &Box<T, A>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1337)### impl<T, A> PartialEq<Box<T, A>> for Box<T, A>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1339)#### fn eq(&self, other: &Box<T, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1343)#### fn ne(&self, other: &Box<T, A>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1348)### impl<T, A> PartialOrd<Box<T, A>> for Box<T, A>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1350)#### fn partial\_cmp(&self, other: &Box<T, A>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1354)#### fn lt(&self, other: &Box<T, A>) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1358)#### fn le(&self, other: &Box<T, A>) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1362)#### fn ge(&self, other: &Box<T, A>) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1366)#### fn gt(&self, other: &Box<T, A>) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1840)### impl<T, A> Pointer for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1841)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#121-156)### impl<R: Read + ?Sized> Read for Box<R> [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#123-125)#### fn read(&mut self, buf: &mut [u8]) -> Result<usize> Pull some bytes from this source into the specified buffer, returning how many bytes were read. [Read more](../io/trait.read#tymethod.read) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#128-130)#### fn read\_buf(&mut self, cursor: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Pull some bytes from this source into the specified buffer. [Read more](../io/trait.read#method.read_buf) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#133-135)#### fn read\_vectored(&mut self, bufs: &mut [IoSliceMut<'\_>]) -> Result<usize> Like `read`, except that it reads into a slice of buffers. [Read more](../io/trait.read#method.read_vectored) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#138-140)#### fn is\_read\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Read`er has an efficient `read_vectored` implementation. [Read more](../io/trait.read#method.is_read_vectored) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#143-145)#### fn read\_to\_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> Read all bytes until EOF in this source, placing them into `buf`. [Read more](../io/trait.read#method.read_to_end) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#148-150)#### fn read\_to\_string(&mut self, buf: &mut String) -> Result<usize> Read all bytes until EOF in this source, appending them to `buf`. [Read more](../io/trait.read#method.read_to_string) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#153-155)#### fn read\_exact(&mut self, buf: &mut [u8]) -> Result<()> Read the exact number of bytes required to fill `buf`. [Read more](../io/trait.read#method.read_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#824-839)#### fn read\_buf\_exact(&mut self, cursor: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Read the exact number of bytes required to fill `cursor`. [Read more](../io/trait.read#method.read_buf_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#876-881)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adaptor for this instance of `Read`. [Read more](../io/trait.read#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#919-924)#### fn bytes(self) -> Bytes<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Bytes](../io/struct.bytes "struct std::io::Bytes")<R> ``` impl<R: Read> Iterator for Bytes<R> type Item = Result<u8>; ``` Transforms this `Read` instance to an [`Iterator`](../iter/trait.iterator "Iterator") over its bytes. [Read more](../io/trait.read#method.bytes) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#957-962)#### fn chain<R: Read>(self, next: R) -> Chain<Self, R>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Chain](../io/struct.chain "struct std::io::Chain")<T, U> ``` impl<T: Read, U: Read> Read for Chain<T, U> ``` Creates an adapter which will chain this stream with another. [Read more](../io/trait.read#method.chain) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#996-1001)#### fn take(self, limit: u64) -> Take<Self>where Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Take](../io/struct.take "struct std::io::Take")<T> ``` impl<T: Read> Read for Take<T> ``` Creates an adapter which will read at most `limit` bytes from it. [Read more](../io/trait.read#method.take) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#190-200)### impl<S: Seek + ?Sized> Seek for Box<S> [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#192-194)#### fn seek(&mut self, pos: SeekFrom) -> Result<u64> Seek to an offset, in bytes, in a stream. [Read more](../io/trait.seek#tymethod.seek) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#197-199)#### fn stream\_position(&mut self) -> Result<u64> Returns the current seek position from the start of the stream. [Read more](../io/trait.seek#method.stream_position) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1796-1799)1.55.0 · #### fn rewind(&mut self) -> Result<()> Rewind to the beginning of a stream. [Read more](../io/trait.seek#method.rewind) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1836-1847)#### fn stream\_len(&mut self) -> Result<u64> 🔬This is a nightly-only experimental API. (`seek_stream_len` [#59359](https://github.com/rust-lang/rust/issues/59359)) Returns the length of this stream (in bytes). [Read more](../io/trait.seek#method.stream_len) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1626)1.43.0 · ### impl<T, const N: usize> TryFrom<Box<[T], Global>> for Box<[T; N], Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1638)#### fn try\_from( boxed\_slice: Box<[T], Global>) -> Result<Box<[T; N], Global>, <Box<[T; N], Global> as TryFrom<Box<[T], Global>>>::Error> Attempts to convert a `Box<[T]>` into a `Box<[T; N]>`. The conversion occurs in-place and does not require a new memory allocation. ##### Errors Returns the old `Box<[T]>` in the `Err` variant if `boxed_slice.len()` does not equal `N`. #### type Error = Box<[T], Global> The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#158-188)### impl<W: Write + ?Sized> Write for Box<W> [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#160-162)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](../io/trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#165-167)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](../io/trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](../io/trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#170-172)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](../io/trait.write#method.write_vectored) implementation. [Read more](../io/trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#175-177)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](../io/trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#180-182)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](../io/trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#185-187)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](../io/trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](../io/trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](../io/trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1959)### impl<T, U, A> CoerceUnsized<Box<U, A>> for Box<T, A>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1962)### impl<T, U> DispatchFromDyn<Box<U, Global>> for Box<T, Global>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1378)### impl<T, A> Eq for Box<T, A>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1933)1.26.0 · ### impl<I, A> FusedIterator for Box<I, A>where I: [FusedIterator](../iter/trait.fusediterator "trait std::iter::FusedIterator") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2041)1.33.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box")) · ### impl<T, A> Unpin for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<T: ?Sized, A> RefUnwindSafe for Box<T, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized, A> Send for Box<T, A>where A: [Send](../marker/trait.send "trait std::marker::Send"), T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T: ?Sized, A> Sync for Box<T, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T: ?Sized, A> UnwindSafe for Box<T, A>where A: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/future/into_future.rs.html#132)### impl<F> IntoFuture for Fwhere F: [Future](../future/trait.future "trait std::future::Future"), #### type Output = <F as Future>::Output The output that the future will produce on completion. #### type IntoFuture = F Which kind of future are we turning this into? [source](https://doc.rust-lang.org/src/core/future/into_future.rs.html#136)#### fn into\_future(self) -> <F as IntoFuture>::IntoFuture Creates a future from a value. [Read more](../future/trait.intofuture#tymethod.into_future) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#905)### impl<'a, F> Pattern<'a> for Fwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([char](../primitive.char)) -> [bool](../primitive.bool), #### type Searcher = CharPredicateSearcher<'a, F> 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Associated searcher for this pattern [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#909)#### fn into\_searcher(self, haystack: &'a str) -> CharPredicateSearcher<'a, F> 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Constructs the associated searcher from `self` and the `haystack` to search in. [Read more](../str/pattern/trait.pattern#tymethod.into_searcher) [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#909)#### fn is\_contained\_in(self, haystack: &'a str) -> bool 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Checks whether the pattern matches anywhere in the haystack [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#909)#### fn is\_prefix\_of(self, haystack: &'a str) -> bool 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Checks whether the pattern matches at the front of the haystack [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#909)#### fn strip\_prefix\_of(self, haystack: &'a str) -> Option<&'a str> 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Removes the pattern from the front of haystack, if it matches. [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#909)#### fn is\_suffix\_of(self, haystack: &'a str) -> boolwhere [CharPredicateSearcher](../str/pattern/struct.charpredicatesearcher "struct std::str::pattern::CharPredicateSearcher")<'a, F>: [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>, 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Checks whether the pattern matches at the back of the haystack [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#909)#### fn strip\_suffix\_of(self, haystack: &'a str) -> Option<&'a str>where [CharPredicateSearcher](../str/pattern/struct.charpredicatesearcher "struct std::str::pattern::CharPredicateSearcher")<'a, F>: [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>, 🔬This is a nightly-only experimental API. (`pattern` [#27721](https://github.com/rust-lang/rust/issues/27721)) Removes the pattern from the back of haystack, if it matches. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::boxed Module std::boxed ================= The `Box<T>` type for heap allocation. [`Box<T>`](struct.box "Box<T>"), casually referred to as a ‘box’, provides the simplest form of heap allocation in Rust. Boxes provide ownership for this allocation, and drop their contents when they go out of scope. Boxes also ensure that they never allocate more than `isize::MAX` bytes. Examples -------- Move a value from the stack to the heap by creating a [`Box`](struct.box "Box"): ``` let val: u8 = 5; let boxed: Box<u8> = Box::new(val); ``` Move a value from a [`Box`](struct.box "Box") back to the stack by [dereferencing](../ops/trait.deref): ``` let boxed: Box<u8> = Box::new(5); let val: u8 = *boxed; ``` Creating a recursive data structure: ``` #[derive(Debug)] enum List<T> { Cons(T, Box<List<T>>), Nil, } let list: List<i32> = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Nil)))); println!("{list:?}"); ``` This will print `Cons(1, Cons(2, Nil))`. Recursive structures must be boxed, because if the definition of `Cons` looked like this: ⓘ ``` Cons(T, List<T>), ``` It wouldn’t work. This is because the size of a `List` depends on how many elements are in the list, and so we don’t know how much memory to allocate for a `Cons`. By introducing a [`Box<T>`](struct.box "Box<T>"), which has a defined size, we know how big `Cons` needs to be. Memory layout ------------- For non-zero-sized values, a [`Box`](struct.box "Box") will use the [`Global`](../alloc/struct.global) allocator for its allocation. It is valid to convert both ways between a [`Box`](struct.box "Box") and a raw pointer allocated with the [`Global`](../alloc/struct.global) allocator, given that the [`Layout`](../alloc/struct.layout) used with the allocator is correct for the type. More precisely, a `value: *mut T` that has been allocated with the [`Global`](../alloc/struct.global) allocator with `Layout::for_value(&*value)` may be converted into a box using [`Box::<T>::from_raw(value)`](struct.box#method.from_raw). Conversely, the memory backing a `value: *mut T` obtained from [`Box::<T>::into_raw`](struct.box#method.into_raw "Box::<T>::into_raw") may be deallocated using the [`Global`](../alloc/struct.global) allocator with [`Layout::for_value(&*value)`](../alloc/struct.layout#method.for_value). For zero-sized values, the `Box` pointer still has to be [valid](../ptr/index#safety) for reads and writes and sufficiently aligned. In particular, casting any aligned non-zero integer literal to a raw pointer produces a valid pointer, but a pointer pointing into previously allocated memory that since got freed is not valid. The recommended way to build a Box to a ZST if `Box::new` cannot be used is to use [`ptr::NonNull::dangling`](../ptr/struct.nonnull#method.dangling "ptr::NonNull::dangling"). So long as `T: Sized`, a `Box<T>` is guaranteed to be represented as a single pointer and is also ABI-compatible with C pointers (i.e. the C type `T*`). This means that if you have extern “C” Rust functions that will be called from C, you can define those Rust functions using `Box<T>` types, and use `T*` as corresponding type on the C side. As an example, consider this C header which declares functions that create and destroy some kind of `Foo` value: ``` /* C header */ /* Returns ownership to the caller */ struct Foo* foo_new(void); /* Takes ownership from the caller; no-op when invoked with null */ void foo_delete(struct Foo*); ``` These two functions might be implemented in Rust as follows. Here, the `struct Foo*` type from C is translated to `Box<Foo>`, which captures the ownership constraints. Note also that the nullable argument to `foo_delete` is represented in Rust as `Option<Box<Foo>>`, since `Box<Foo>` cannot be null. ``` #[repr(C)] pub struct Foo; #[no_mangle] pub extern "C" fn foo_new() -> Box<Foo> { Box::new(Foo) } #[no_mangle] pub extern "C" fn foo_delete(_: Option<Box<Foo>>) {} ``` Even though `Box<T>` has the same representation and C ABI as a C pointer, this does not mean that you can convert an arbitrary `T*` into a `Box<T>` and expect things to work. `Box<T>` values will always be fully aligned, non-null pointers. Moreover, the destructor for `Box<T>` will attempt to free the value with the global allocator. In general, the best practice is to only use `Box<T>` for pointers that originated from the global allocator. **Important.** At least at present, you should avoid using `Box<T>` types for functions that are defined in C but invoked from Rust. In those cases, you should directly mirror the C types as closely as possible. Using types like `Box<T>` where the C definition is just using `T*` can lead to undefined behavior, as described in [rust-lang/unsafe-code-guidelines#198](https://github.com/rust-lang/unsafe-code-guidelines/issues/198). Considerations for unsafe code ------------------------------ **Warning: This section is not normative and is subject to change, possibly being relaxed in the future! It is a simplified summary of the rules currently implemented in the compiler.** The aliasing rules for `Box<T>` are the same as for `&mut T`. `Box<T>` asserts uniqueness over its content. Using raw pointers derived from a box after that box has been mutated through, moved or borrowed as `&mut T` is not allowed. For more guidance on working with box from unsafe code, see [rust-lang/unsafe-code-guidelines#326](https://github.com/rust-lang/unsafe-code-guidelines/issues/326). Structs ------- [ThinBox](struct.thinbox "std::boxed::ThinBox struct")Experimental ThinBox. [Box](struct.box "std::boxed::Box struct") A pointer type for heap allocation. rust Struct std::boxed::ThinBox Struct std::boxed::ThinBox ========================== ``` pub struct ThinBox<T>where    T: ?Sized,{ /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`thin_box` [#92791](https://github.com/rust-lang/rust/issues/92791)) ThinBox. A thin pointer for heap allocation, regardless of T. Examples -------- ``` #![feature(thin_box)] use std::boxed::ThinBox; let five = ThinBox::new(5); let thin_slice = ThinBox::<[i32]>::new_unsize([1, 2, 3, 4]); use std::mem::{size_of, size_of_val}; let size_of_ptr = size_of::<*const ()>(); assert_eq!(size_of_ptr, size_of_val(&five)); assert_eq!(size_of_ptr, size_of_val(&thin_slice)); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#51)### impl<T> ThinBox<T> [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#64)#### pub fn new(value: T) -> ThinBox<T> 🔬This is a nightly-only experimental API. (`thin_box` [#92791](https://github.com/rust-lang/rust/issues/92791)) Moves a type to the heap with its `Metadata` stored in the heap allocation instead of on the stack. ##### Examples ``` #![feature(thin_box)] use std::boxed::ThinBox; let five = ThinBox::new(5); ``` [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#72)### impl<Dyn> ThinBox<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#85-87)#### pub fn new\_unsize<T>(value: T) -> ThinBox<Dyn>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<Dyn>, 🔬This is a nightly-only experimental API. (`thin_box` [#92791](https://github.com/rust-lang/rust/issues/92791)) Moves a type to the heap with its `Metadata` stored in the heap allocation instead of on the stack. ##### Examples ``` #![feature(thin_box)] use std::boxed::ThinBox; let thin_slice = ThinBox::<[i32]>::new_unsize([1, 2, 3, 4]); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#96)### impl<T> Debug for ThinBox<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#97)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#110)### impl<T> Deref for ThinBox<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#113)#### fn deref(&self) -> &T Dereferences the value. [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#122)### impl<T> DerefMut for ThinBox<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#123)#### fn deref\_mut(&mut self) -> &mut T Mutably dereferences the value. [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#103)### impl<T> Display for ThinBox<T>where T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#104)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#132)### impl<T> Drop for ThinBox<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#133)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#279)### impl<T> Error for ThinBox<T>where T: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#280)#### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#109)1.0.0 · #### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#44)### impl<T> Send for ThinBox<T>where T: [Send](../marker/trait.send "trait std::marker::Send") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), `ThinBox<T>` is `Send` if `T` is `Send` because the data is owned. [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#48)### impl<T> Sync for ThinBox<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), `ThinBox<T>` is `Sync` if `T` is `Sync` because the data is owned. Auto Trait Implementations -------------------------- ### impl<T: ?Sized> RefUnwindSafe for ThinBox<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> Unpin for ThinBox<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T: ?Sized> UnwindSafe for ThinBox<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::option Module std::option ================== Optional values. Type [`Option`](enum.option "Option") represents an optional value: every [`Option`](enum.option "Option") is either [`Some`](enum.option#variant.Some "Some") and contains a value, or [`None`](enum.option#variant.None "None"), and does not. [`Option`](enum.option "Option") types are very common in Rust code, as they have a number of uses: * Initial values * Return values for functions that are not defined over their entire input range (partial functions) * Return value for otherwise reporting simple errors, where [`None`](enum.option#variant.None "None") is returned on error * Optional struct fields * Struct fields that can be loaned or “taken” * Optional function arguments * Nullable pointers * Swapping things out of difficult situations [`Option`](enum.option "Option")s are commonly paired with pattern matching to query the presence of a value and take action, always accounting for the [`None`](enum.option#variant.None "None") case. ``` fn divide(numerator: f64, denominator: f64) -> Option<f64> { if denominator == 0.0 { None } else { Some(numerator / denominator) } } // The return value of the function is an option let result = divide(2.0, 3.0); // Pattern match to retrieve the value match result { // The division was valid Some(x) => println!("Result: {x}"), // The division was invalid None => println!("Cannot divide by 0"), } ``` Options and pointers (“nullable” pointers) ------------------------------------------ Rust’s pointer types must always point to a valid location; there are no “null” references. Instead, Rust has *optional* pointers, like the optional owned box, `[Option](enum.option "Option")<[Box<T>](../boxed/struct.box)>`. The following example uses [`Option`](enum.option "Option") to create an optional box of [`i32`](../primitive.i32 "i32"). Notice that in order to use the inner [`i32`](../primitive.i32 "i32") value, the `check_optional` function first needs to use pattern matching to determine whether the box has a value (i.e., it is [`Some(...)`](enum.option#variant.Some "Some")) or not ([`None`](enum.option#variant.None "None")). ``` let optional = None; check_optional(optional); let optional = Some(Box::new(9000)); check_optional(optional); fn check_optional(optional: Option<Box<i32>>) { match optional { Some(p) => println!("has value {p}"), None => println!("has no value"), } } ``` Representation -------------- Rust guarantees to optimize the following types `T` such that [`Option<T>`](enum.option "Option<T>") has the same size as `T`: * [`Box<U>`](../boxed/struct.box) * `&U` * `&mut U` * `fn`, `extern "C" fn`[1](#fn1) * [`num::NonZero*`](https://doc.rust-lang.org/core/num/index.html) * [`ptr::NonNull<U>`](../ptr/struct.nonnull) * `#[repr(transparent)]` struct around one of the types in this list. This is called the “null pointer optimization” or NPO. It is further guaranteed that, for the cases above, one can [`mem::transmute`](../mem/fn.transmute "mem::transmute") from all valid values of `T` to `Option<T>` and from `Some::<T>(_)` to `T` (but transmuting `None::<T>` to `T` is undefined behaviour). Method overview --------------- In addition to working with pattern matching, [`Option`](enum.option "Option") provides a wide variety of different methods. ### Querying the variant The [`is_some`](enum.option#method.is_some) and [`is_none`](enum.option#method.is_none) methods return [`true`](../primitive.bool "true") if the [`Option`](enum.option "Option") is [`Some`](enum.option#variant.Some "Some") or [`None`](enum.option#variant.None "None"), respectively. ### Adapters for working with references * [`as_ref`](enum.option#method.as_ref) converts from `[&](../primitive.reference "shared reference")[Option](enum.option "Option")<T>` to `[Option](enum.option "Option")<[&](../primitive.reference "shared reference")T>` * [`as_mut`](enum.option#method.as_mut) converts from `[&mut](../primitive.reference "mutable reference") [Option](enum.option "Option")<T>` to `[Option](enum.option "Option")<[&mut](../primitive.reference "mutable reference") T>` * [`as_deref`](enum.option#method.as_deref) converts from `[&](../primitive.reference "shared reference")[Option](enum.option "Option")<T>` to `[Option](enum.option "Option")<[&](../primitive.reference "shared reference")T::[Target](../ops/trait.deref#associatedtype.Target "ops::Deref::Target")>` * [`as_deref_mut`](enum.option#method.as_deref_mut) converts from `[&mut](../primitive.reference "mutable reference") [Option](enum.option "Option")<T>` to `[Option](enum.option "Option")<[&mut](../primitive.reference "mutable reference") T::[Target](../ops/trait.deref#associatedtype.Target "ops::Deref::Target")>` * [`as_pin_ref`](enum.option#method.as_pin_ref) converts from `[Pin](../pin/struct.pin "Pin")<[&](../primitive.reference "shared reference")[Option](enum.option "Option")<T>>` to `[Option](enum.option "Option")<[Pin](../pin/struct.pin "Pin")<[&](../primitive.reference "shared reference")T>>` * [`as_pin_mut`](enum.option#method.as_pin_mut) converts from `[Pin](../pin/struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") [Option](enum.option "Option")<T>>` to `[Option](enum.option "Option")<[Pin](../pin/struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") T>>` ### Extracting the contained value These methods extract the contained value in an [`Option<T>`](enum.option "Option<T>") when it is the [`Some`](enum.option#variant.Some "Some") variant. If the [`Option`](enum.option "Option") is [`None`](enum.option#variant.None "None"): * [`expect`](enum.option#method.expect) panics with a provided custom message * [`unwrap`](enum.option#method.unwrap) panics with a generic message * [`unwrap_or`](enum.option#method.unwrap_or) returns the provided default value * [`unwrap_or_default`](enum.option#method.unwrap_or_default) returns the default value of the type `T` (which must implement the [`Default`](../default/trait.default "Default") trait) * [`unwrap_or_else`](enum.option#method.unwrap_or_else) returns the result of evaluating the provided function ### Transforming contained values These methods transform [`Option`](enum.option "Option") to [`Result`](../result/enum.result "Result"): * [`ok_or`](enum.option#method.ok_or) transforms [`Some(v)`](enum.option#variant.Some) to [`Ok(v)`](../result/enum.result#variant.Ok), and [`None`](enum.option#variant.None "None") to [`Err(err)`](../result/enum.result#variant.Err) using the provided default `err` value * [`ok_or_else`](enum.option#method.ok_or_else) transforms [`Some(v)`](enum.option#variant.Some) to [`Ok(v)`](../result/enum.result#variant.Ok), and [`None`](enum.option#variant.None "None") to a value of [`Err`](../result/enum.result#variant.Err "Err") using the provided function * [`transpose`](enum.option#method.transpose) transposes an [`Option`](enum.option "Option") of a [`Result`](../result/enum.result "Result") into a [`Result`](../result/enum.result "Result") of an [`Option`](enum.option "Option") These methods transform the [`Some`](enum.option#variant.Some "Some") variant: * [`filter`](enum.option#method.filter) calls the provided predicate function on the contained value `t` if the [`Option`](enum.option "Option") is [`Some(t)`](enum.option#variant.Some), and returns [`Some(t)`](enum.option#variant.Some) if the function returns `true`; otherwise, returns [`None`](enum.option#variant.None "None") * [`flatten`](enum.option#method.flatten) removes one level of nesting from an [`Option<Option<T>>`](enum.option "Option<Option<T>>") * [`map`](enum.option#method.map) transforms [`Option<T>`](enum.option "Option<T>") to [`Option<U>`](enum.option "Option<U>") by applying the provided function to the contained value of [`Some`](enum.option#variant.Some "Some") and leaving [`None`](enum.option#variant.None "None") values unchanged These methods transform [`Option<T>`](enum.option "Option<T>") to a value of a possibly different type `U`: * [`map_or`](enum.option#method.map_or) applies the provided function to the contained value of [`Some`](enum.option#variant.Some "Some"), or returns the provided default value if the [`Option`](enum.option "Option") is [`None`](enum.option#variant.None "None") * [`map_or_else`](enum.option#method.map_or_else) applies the provided function to the contained value of [`Some`](enum.option#variant.Some "Some"), or returns the result of evaluating the provided fallback function if the [`Option`](enum.option "Option") is [`None`](enum.option#variant.None "None") These methods combine the [`Some`](enum.option#variant.Some "Some") variants of two [`Option`](enum.option "Option") values: * [`zip`](enum.option#method.zip) returns [`Some((s, o))`](enum.option#variant.Some) if `self` is [`Some(s)`](enum.option#variant.Some) and the provided [`Option`](enum.option "Option") value is [`Some(o)`](enum.option#variant.Some); otherwise, returns [`None`](enum.option#variant.None "None") * [`zip_with`](enum.option#method.zip_with) calls the provided function `f` and returns [`Some(f(s, o))`](enum.option#variant.Some) if `self` is [`Some(s)`](enum.option#variant.Some) and the provided [`Option`](enum.option "Option") value is [`Some(o)`](enum.option#variant.Some); otherwise, returns [`None`](enum.option#variant.None "None") ### Boolean operators These methods treat the [`Option`](enum.option "Option") as a boolean value, where [`Some`](enum.option#variant.Some "Some") acts like [`true`](../primitive.bool "true") and [`None`](enum.option#variant.None "None") acts like [`false`](../primitive.bool "false"). There are two categories of these methods: ones that take an [`Option`](enum.option "Option") as input, and ones that take a function as input (to be lazily evaluated). The [`and`](enum.option#method.and), [`or`](enum.option#method.or), and [`xor`](enum.option#method.xor) methods take another [`Option`](enum.option "Option") as input, and produce an [`Option`](enum.option "Option") as output. Only the [`and`](enum.option#method.and) method can produce an [`Option<U>`](enum.option "Option<U>") value having a different inner type `U` than [`Option<T>`](enum.option "Option<T>"). | method | self | input | output | | --- | --- | --- | --- | | [`and`](enum.option#method.and) | `None` | (ignored) | `None` | | [`and`](enum.option#method.and) | `Some(x)` | `None` | `None` | | [`and`](enum.option#method.and) | `Some(x)` | `Some(y)` | `Some(y)` | | [`or`](enum.option#method.or) | `None` | `None` | `None` | | [`or`](enum.option#method.or) | `None` | `Some(y)` | `Some(y)` | | [`or`](enum.option#method.or) | `Some(x)` | (ignored) | `Some(x)` | | [`xor`](enum.option#method.xor) | `None` | `None` | `None` | | [`xor`](enum.option#method.xor) | `None` | `Some(y)` | `Some(y)` | | [`xor`](enum.option#method.xor) | `Some(x)` | `None` | `Some(x)` | | [`xor`](enum.option#method.xor) | `Some(x)` | `Some(y)` | `None` | The [`and_then`](enum.option#method.and_then) and [`or_else`](enum.option#method.or_else) methods take a function as input, and only evaluate the function when they need to produce a new value. Only the [`and_then`](enum.option#method.and_then) method can produce an [`Option<U>`](enum.option "Option<U>") value having a different inner type `U` than [`Option<T>`](enum.option "Option<T>"). | method | self | function input | function result | output | | --- | --- | --- | --- | --- | | [`and_then`](enum.option#method.and_then) | `None` | (not provided) | (not evaluated) | `None` | | [`and_then`](enum.option#method.and_then) | `Some(x)` | `x` | `None` | `None` | | [`and_then`](enum.option#method.and_then) | `Some(x)` | `x` | `Some(y)` | `Some(y)` | | [`or_else`](enum.option#method.or_else) | `None` | (not provided) | `None` | `None` | | [`or_else`](enum.option#method.or_else) | `None` | (not provided) | `Some(y)` | `Some(y)` | | [`or_else`](enum.option#method.or_else) | `Some(x)` | (not provided) | (not evaluated) | `Some(x)` | This is an example of using methods like [`and_then`](enum.option#method.and_then) and [`or`](enum.option#method.or) in a pipeline of method calls. Early stages of the pipeline pass failure values ([`None`](enum.option#variant.None "None")) through unchanged, and continue processing on success values ([`Some`](enum.option#variant.Some "Some")). Toward the end, [`or`](enum.option#method.or) substitutes an error message if it receives [`None`](enum.option#variant.None "None"). ``` let mut bt = BTreeMap::new(); bt.insert(20u8, "foo"); bt.insert(42u8, "bar"); let res = [0u8, 1, 11, 200, 22] .into_iter() .map(|x| { // `checked_sub()` returns `None` on error x.checked_sub(1) // same with `checked_mul()` .and_then(|x| x.checked_mul(2)) // `BTreeMap::get` returns `None` on error .and_then(|x| bt.get(&x)) // Substitute an error message if we have `None` so far .or(Some(&"error!")) .copied() // Won't panic because we unconditionally used `Some` above .unwrap() }) .collect::<Vec<_>>(); assert_eq!(res, ["error!", "error!", "foo", "error!", "bar"]); ``` ### Comparison operators If `T` implements [`PartialOrd`](../cmp/trait.partialord "PartialOrd") then [`Option<T>`](enum.option "Option<T>") will derive its [`PartialOrd`](../cmp/trait.partialord "PartialOrd") implementation. With this order, [`None`](enum.option#variant.None "None") compares as less than any [`Some`](enum.option#variant.Some "Some"), and two [`Some`](enum.option#variant.Some "Some") compare the same way as their contained values would in `T`. If `T` also implements [`Ord`](../cmp/trait.ord "Ord"), then so does [`Option<T>`](enum.option "Option<T>"). ``` assert!(None < Some(0)); assert!(Some(0) < Some(1)); ``` ### Iterating over `Option` An [`Option`](enum.option "Option") can be iterated over. This can be helpful if you need an iterator that is conditionally empty. The iterator will either produce a single value (when the [`Option`](enum.option "Option") is [`Some`](enum.option#variant.Some "Some")), or produce no values (when the [`Option`](enum.option "Option") is [`None`](enum.option#variant.None "None")). For example, [`into_iter`](enum.option#method.into_iter) acts like [`once(v)`](../iter/fn.once) if the [`Option`](enum.option "Option") is [`Some(v)`](enum.option#variant.Some), and like [`empty()`](../iter/fn.empty) if the [`Option`](enum.option "Option") is [`None`](enum.option#variant.None "None"). Iterators over [`Option<T>`](enum.option "Option<T>") come in three types: * [`into_iter`](enum.option#method.into_iter) consumes the [`Option`](enum.option "Option") and produces the contained value * [`iter`](enum.option#method.iter) produces an immutable reference of type `&T` to the contained value * [`iter_mut`](enum.option#method.iter_mut) produces a mutable reference of type `&mut T` to the contained value An iterator over [`Option`](enum.option "Option") can be useful when chaining iterators, for example, to conditionally insert items. (It’s not always necessary to explicitly call an iterator constructor: many [`Iterator`](../iter/trait.iterator "Iterator") methods that accept other iterators will also accept iterable types that implement [`IntoIterator`](../iter/trait.intoiterator "IntoIterator"), which includes [`Option`](enum.option "Option").) ``` let yep = Some(42); let nope = None; // chain() already calls into_iter(), so we don't have to do so let nums: Vec<i32> = (0..4).chain(yep).chain(4..8).collect(); assert_eq!(nums, [0, 1, 2, 3, 42, 4, 5, 6, 7]); let nums: Vec<i32> = (0..4).chain(nope).chain(4..8).collect(); assert_eq!(nums, [0, 1, 2, 3, 4, 5, 6, 7]); ``` One reason to chain iterators in this way is that a function returning `impl Iterator` must have all possible return values be of the same concrete type. Chaining an iterated [`Option`](enum.option "Option") can help with that. ``` fn make_iter(do_insert: bool) -> impl Iterator<Item = i32> { // Explicit returns to illustrate return types matching match do_insert { true => return (0..4).chain(Some(42)).chain(4..8), false => return (0..4).chain(None).chain(4..8), } } println!("{:?}", make_iter(true).collect::<Vec<_>>()); println!("{:?}", make_iter(false).collect::<Vec<_>>()); ``` If we try to do the same thing, but using [`once()`](../iter/fn.once) and [`empty()`](../iter/fn.empty), we can’t return `impl Iterator` anymore because the concrete types of the return values differ. ⓘ ``` // This won't compile because all possible returns from the function // must have the same concrete type. fn make_iter(do_insert: bool) -> impl Iterator<Item = i32> { // Explicit returns to illustrate return types not matching match do_insert { true => return (0..4).chain(once(42)).chain(4..8), false => return (0..4).chain(empty()).chain(4..8), } } ``` ### Collecting into `Option` [`Option`](enum.option "Option") implements the [`FromIterator`](enum.option#impl-FromIterator%3COption%3CA%3E%3E-for-Option%3CV%3E) trait, which allows an iterator over [`Option`](enum.option "Option") values to be collected into an [`Option`](enum.option "Option") of a collection of each contained value of the original [`Option`](enum.option "Option") values, or [`None`](enum.option#variant.None "None") if any of the elements was [`None`](enum.option#variant.None "None"). ``` let v = [Some(2), Some(4), None, Some(8)]; let res: Option<Vec<_>> = v.into_iter().collect(); assert_eq!(res, None); let v = [Some(2), Some(4), Some(8)]; let res: Option<Vec<_>> = v.into_iter().collect(); assert_eq!(res, Some(vec![2, 4, 8])); ``` [`Option`](enum.option "Option") also implements the [`Product`](enum.option#impl-Product%3COption%3CU%3E%3E-for-Option%3CT%3E) and [`Sum`](enum.option#impl-Sum%3COption%3CU%3E%3E-for-Option%3CT%3E) traits, allowing an iterator over [`Option`](enum.option "Option") values to provide the [`product`](../iter/trait.iterator#method.product "Iterator::product") and [`sum`](../iter/trait.iterator#method.sum "Iterator::sum") methods. ``` let v = [None, Some(1), Some(2), Some(3)]; let res: Option<i32> = v.into_iter().sum(); assert_eq!(res, None); let v = [Some(1), Some(2), Some(21)]; let res: Option<i32> = v.into_iter().product(); assert_eq!(res, Some(42)); ``` ### Modifying an `Option` in-place These methods return a mutable reference to the contained value of an [`Option<T>`](enum.option "Option<T>"): * [`insert`](enum.option#method.insert) inserts a value, dropping any old contents * [`get_or_insert`](enum.option#method.get_or_insert) gets the current value, inserting a provided default value if it is [`None`](enum.option#variant.None "None") * [`get_or_insert_default`](enum.option#method.get_or_insert_default) gets the current value, inserting the default value of type `T` (which must implement [`Default`](../default/trait.default "Default")) if it is [`None`](enum.option#variant.None "None") * [`get_or_insert_with`](enum.option#method.get_or_insert_with) gets the current value, inserting a default computed by the provided function if it is [`None`](enum.option#variant.None "None") These methods transfer ownership of the contained value of an [`Option`](enum.option "Option"): * [`take`](enum.option#method.take) takes ownership of the contained value of an [`Option`](enum.option "Option"), if any, replacing the [`Option`](enum.option "Option") with [`None`](enum.option#variant.None "None") * [`replace`](enum.option#method.replace) takes ownership of the contained value of an [`Option`](enum.option "Option"), if any, replacing the [`Option`](enum.option "Option") with a [`Some`](enum.option#variant.Some "Some") containing the provided value Examples -------- Basic pattern matching on [`Option`](enum.option "Option"): ``` let msg = Some("howdy"); // Take a reference to the contained string if let Some(m) = &msg { println!("{}", *m); } // Remove the contained string, destroying the Option let unwrapped_msg = msg.unwrap_or("default message"); ``` Initialize a result to [`None`](enum.option#variant.None "None") before a loop: ``` enum Kingdom { Plant(u32, &'static str), Animal(u32, &'static str) } // A list of data to search through. let all_the_big_things = [ Kingdom::Plant(250, "redwood"), Kingdom::Plant(230, "noble fir"), Kingdom::Plant(229, "sugar pine"), Kingdom::Animal(25, "blue whale"), Kingdom::Animal(19, "fin whale"), Kingdom::Animal(15, "north pacific right whale"), ]; // We're going to search for the name of the biggest animal, // but to start with we've just got `None`. let mut name_of_biggest_animal = None; let mut size_of_biggest_animal = 0; for big_thing in &all_the_big_things { match *big_thing { Kingdom::Animal(size, name) if size > size_of_biggest_animal => { // Now we've found the name of some big animal size_of_biggest_animal = size; name_of_biggest_animal = Some(name); } Kingdom::Animal(..) | Kingdom::Plant(..) => () } } match name_of_biggest_animal { Some(name) => println!("the biggest animal is {name}"), None => println!("there are no animals :("), } ``` 1. this remains true for any other ABI: `extern "abi" fn` (*e.g.*, `extern "system" fn`) [↩](#fnref1) Structs ------- [IntoIter](struct.intoiter "std::option::IntoIter struct") An iterator over the value in [`Some`](enum.option#variant.Some "Some") variant of an [`Option`](enum.option "Option"). [Iter](struct.iter "std::option::Iter struct") An iterator over a reference to the [`Some`](enum.option#variant.Some "Some") variant of an [`Option`](enum.option "Option"). [IterMut](struct.itermut "std::option::IterMut struct") An iterator over a mutable reference to the [`Some`](enum.option#variant.Some "Some") variant of an [`Option`](enum.option "Option"). Enums ----- [Option](enum.option "std::option::Option enum") The `Option` type. See [the module level documentation](index) for more.
programming_docs
rust Struct std::option::IterMut Struct std::option::IterMut =========================== ``` pub struct IterMut<'a, A>where    A: 'a,{ /* private fields */ } ``` An iterator over a mutable reference to the [`Some`](enum.option#variant.Some "Some") variant of an [`Option`](enum.option "Option"). The iterator yields one value if the [`Option`](enum.option "Option") is a [`Some`](enum.option#variant.Some "Some"), otherwise none. This `struct` is created by the [`Option::iter_mut`](enum.option#method.iter_mut "Option::iter_mut") function. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/option.rs.html#2132)### impl<'a, A> Debug for IterMut<'a, A>where A: 'a + [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/option.rs.html#2132)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/option.rs.html#2152)### impl<'a, A> DoubleEndedIterator for IterMut<'a, A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2154)#### fn next\_back(&mut self) -> Option<&'a mut A> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/core/option.rs.html#2160)### impl<A> ExactSizeIterator for IterMut<'\_, A> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/option.rs.html#2138)### impl<'a, A> Iterator for IterMut<'a, A> #### type Item = &'a mut A The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/core/option.rs.html#2142)#### fn next(&mut self) -> Option<&'a mut A> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/option.rs.html#2146)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)#### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/core/option.rs.html#2163)1.26.0 · ### impl<A> FusedIterator for IterMut<'\_, A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2165)### impl<A> TrustedLen for IterMut<'\_, A> Auto Trait Implementations -------------------------- ### impl<'a, A> RefUnwindSafe for IterMut<'a, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, A> Send for IterMut<'a, A>where A: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<'a, A> Sync for IterMut<'a, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<'a, A> Unpin for IterMut<'a, A> ### impl<'a, A> !UnwindSafe for IterMut<'a, A> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::option::IntoIter Struct std::option::IntoIter ============================ ``` pub struct IntoIter<A> { /* private fields */ } ``` An iterator over the value in [`Some`](enum.option#variant.Some "Some") variant of an [`Option`](enum.option "Option"). The iterator yields one value if the [`Option`](enum.option "Option") is a [`Some`](enum.option#variant.Some "Some"), otherwise none. This `struct` is created by the [`Option::into_iter`](enum.option#method.into_iter "Option::into_iter") function. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/option.rs.html#2172)### impl<A> Clone for IntoIter<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/option.rs.html#2172)#### fn clone(&self) -> IntoIter<A> Notable traits for [IntoIter](struct.intoiter "struct std::option::IntoIter")<A> ``` impl<A> Iterator for IntoIter<A> type Item = A; ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/option.rs.html#2172)### impl<A> Debug for IntoIter<A>where A: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/option.rs.html#2172)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/option.rs.html#2193)### impl<A> DoubleEndedIterator for IntoIter<A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2195)#### fn next\_back(&mut self) -> Option<A> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/core/option.rs.html#2201)### impl<A> ExactSizeIterator for IntoIter<A> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/option.rs.html#2179)### impl<A> Iterator for IntoIter<A> #### type Item = A The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/core/option.rs.html#2183)#### fn next(&mut self) -> Option<A> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/option.rs.html#2187)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)#### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/core/option.rs.html#2204)1.26.0 · ### impl<A> FusedIterator for IntoIter<A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2207)### impl<A> TrustedLen for IntoIter<A> Auto Trait Implementations -------------------------- ### impl<A> RefUnwindSafe for IntoIter<A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<A> Send for IntoIter<A>where A: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<A> Sync for IntoIter<A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<A> Unpin for IntoIter<A>where A: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<A> UnwindSafe for IntoIter<A>where A: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Enum std::option::Option Enum std::option::Option ======================== ``` pub enum Option<T> { None, Some(T), } ``` The `Option` type. See [the module level documentation](index) for more. Variants -------- ### `None` No value. ### `Some(T)` Some value of type `T`. Implementations --------------- [source](https://doc.rust-lang.org/src/core/option.rs.html#533)### impl<T> Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#553)const: 1.48.0 · #### pub const fn is\_some(&self) -> bool Returns `true` if the option is a [`Some`](enum.option#variant.Some "Some") value. ##### Examples ``` let x: Option<u32> = Some(2); assert_eq!(x.is_some(), true); let x: Option<u32> = None; assert_eq!(x.is_some(), false); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#576)#### pub fn is\_some\_and(&self, f: impl FnOnce(&T) -> bool) -> bool 🔬This is a nightly-only experimental API. (`is_some_with` [#93050](https://github.com/rust-lang/rust/issues/93050)) Returns `true` if the option is a [`Some`](enum.option#variant.Some "Some") and the value inside of it matches a predicate. ##### Examples ``` #![feature(is_some_with)] let x: Option<u32> = Some(2); assert_eq!(x.is_some_and(|&x| x > 1), true); let x: Option<u32> = Some(0); assert_eq!(x.is_some_and(|&x| x > 1), false); let x: Option<u32> = None; assert_eq!(x.is_some_and(|&x| x > 1), false); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#596)const: 1.48.0 · #### pub const fn is\_none(&self) -> bool Returns `true` if the option is a [`None`](enum.option#variant.None "None") value. ##### Examples ``` let x: Option<u32> = Some(2); assert_eq!(x.is_none(), false); let x: Option<u32> = None; assert_eq!(x.is_none(), true); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#626)const: 1.48.0 · #### pub const fn as\_ref(&self) -> Option<&T> Converts from `&Option<T>` to `Option<&T>`. ##### Examples Converts an `Option<[String](../string/struct.string "String")>` into an `Option<[usize](../primitive.usize "usize")>`, preserving the original. The [`map`](enum.option#method.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 text: Option<String> = Some("Hello, world!".to_string()); // First, cast `Option<String>` to `Option<&String>` with `as_ref`, // then consume *that* with `map`, leaving `text` on the stack. let text_length: Option<usize> = text.as_ref().map(|s| s.len()); println!("still can print text: {text:?}"); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#648)const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option") · #### pub fn as\_mut(&mut self) -> Option<&mut T> Converts from `&mut Option<T>` to `Option<&mut T>`. ##### Examples ``` let mut x = Some(2); match x.as_mut() { Some(v) => *v = 42, None => {}, } assert_eq!(x, Some(42)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#662)1.33.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn as\_pin\_ref(self: Pin<&Option<T>>) -> Option<Pin<&T>> Converts from `[Pin](../pin/struct.pin "Pin")<[&](../primitive.reference "shared reference")Option<T>>` to `Option<[Pin](../pin/struct.pin "Pin")<[&](../primitive.reference "shared reference")T>>`. [source](https://doc.rust-lang.org/src/core/option.rs.html#678)1.33.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn as\_pin\_mut(self: Pin<&mut Option<T>>) -> Option<Pin<&mut T>> Converts from `[Pin](../pin/struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Option<T>>` to `Option<[Pin](../pin/struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") T>>`. [source](https://doc.rust-lang.org/src/core/option.rs.html#735)const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option") · #### pub fn expect(self, msg: &str) -> T Returns the contained [`Some`](enum.option#variant.Some "Some") value, consuming the `self` value. ##### Panics Panics if the value is a [`None`](enum.option#variant.None "None") with a custom panic message provided by `msg`. ##### Examples ``` let x = Some("value"); assert_eq!(x.expect("fruits are healthy"), "value"); ``` ⓘ ``` let x: Option<&str> = None; x.expect("fruits are healthy"); // panics with `fruits are healthy` ``` ##### Recommended Message Style We recommend that `expect` messages are used to describe the reason you *expect* the `Option` should be `Some`. ⓘ ``` let item = slice.get(0) .expect("slice should not be empty"); ``` **Hint**: If you’re having trouble remembering how to phrase expect error messages remember to focus on the word “should” as in “env variable should be set by blah” or “the given binary should be available and executable by the current user”. For more detail on expect message styles and the reasoning behind our recommendation please refer to the section on [“Common Message Styles”](../error/index#common-message-styles) in the [`std::error`](../error/index) module docs. [source](https://doc.rust-lang.org/src/core/option.rs.html#772)const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option") · #### pub fn unwrap(self) -> T Returns the contained [`Some`](enum.option#variant.Some "Some") value, consuming the `self` value. Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the [`None`](enum.option#variant.None "None") case explicitly, or call [`unwrap_or`](enum.option#method.unwrap_or), [`unwrap_or_else`](enum.option#method.unwrap_or_else), or [`unwrap_or_default`](enum.option#method.unwrap_or_default). ##### Panics Panics if the self value equals [`None`](enum.option#variant.None "None"). ##### Examples ``` let x = Some("air"); assert_eq!(x.unwrap(), "air"); ``` ⓘ ``` let x: Option<&str> = None; assert_eq!(x.unwrap(), "air"); // fails ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#796-798)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn unwrap\_or(self, default: T) -> T Returns the contained [`Some`](enum.option#variant.Some "Some") value or a provided default. Arguments passed to `unwrap_or` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use [`unwrap_or_else`](enum.option#method.unwrap_or_else), which is lazily evaluated. ##### Examples ``` assert_eq!(Some("car").unwrap_or("bike"), "car"); assert_eq!(None.unwrap_or("bike"), "bike"); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#818-821)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn unwrap\_or\_else<F>(self, f: F) -> Twhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> T, Returns the contained [`Some`](enum.option#variant.Some "Some") value or computes it from a closure. ##### Examples ``` let k = 10; assert_eq!(Some(4).unwrap_or_else(|| 2 * k), 4); assert_eq!(None.unwrap_or_else(|| 2 * k), 20); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#858-860)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn unwrap\_or\_default(self) -> Twhere T: [Default](../default/trait.default "trait std::default::Default"), Returns the contained [`Some`](enum.option#variant.Some "Some") value or a default. Consumes the `self` argument then, if [`Some`](enum.option#variant.Some "Some"), returns the contained value, otherwise if [`None`](enum.option#variant.None "None"), returns the [default value](../default/trait.default#tymethod.default) for that type. ##### Examples Converts a string to an integer, turning poorly-formed strings into 0 (the default value for integers). [`parse`](../primitive.str#method.parse) converts a string to any other type that implements [`FromStr`](../str/trait.fromstr), returning [`None`](enum.option#variant.None "None") on error. ``` let good_year_from_input = "1909"; let bad_year_from_input = "190blarg"; let good_year = good_year_from_input.parse().ok().unwrap_or_default(); let bad_year = bad_year_from_input.parse().ok().unwrap_or_default(); assert_eq!(1909, good_year); assert_eq!(0, bad_year); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#892)1.58.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub unsafe fn unwrap\_unchecked(self) -> T Returns the contained [`Some`](enum.option#variant.Some "Some") value, consuming the `self` value, without checking that the value is not [`None`](enum.option#variant.None "None"). ##### Safety Calling this method on [`None`](enum.option#variant.None "None") is *[undefined behavior](../../reference/behavior-considered-undefined)*. ##### Examples ``` let x = Some("air"); assert_eq!(unsafe { x.unwrap_unchecked() }, "air"); ``` ``` let x: Option<&str> = None; assert_eq!(unsafe { x.unwrap_unchecked() }, "air"); // Undefined behavior! ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#923-926)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn map<U, F>(self, f: F) -> Option<U>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U, Maps an `Option<T>` to `Option<U>` by applying a function to a contained value. ##### Examples Converts an `Option<[String](../string/struct.string "String")>` into an `Option<[usize](../primitive.usize "usize")>`, consuming the original: ``` let maybe_some_string = Some(String::from("Hello, World!")); // `Option::map` takes self *by value*, consuming `maybe_some_string` let maybe_some_len = maybe_some_string.map(|s| s.len()); assert_eq!(maybe_some_len, Some(13)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#952-955)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn inspect<F>(self, f: F) -> Option<T>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&](../primitive.reference)T), 🔬This is a nightly-only experimental API. (`result_option_inspect` [#91345](https://github.com/rust-lang/rust/issues/91345)) Calls the provided closure with a reference to the contained value (if [`Some`](enum.option#variant.Some "Some")). ##### Examples ``` #![feature(result_option_inspect)] let v = vec![1, 2, 3, 4, 5]; // prints "got: 4" let x: Option<&usize> = v.get(3).inspect(|x| println!("got: {x}")); // prints nothing let x: Option<&usize> = v.get(5).inspect(|x| println!("got: {x}")); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#985-989)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn map\_or<U, F>(self, default: U, f: F) -> Uwhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U, Returns the provided default result (if none), or applies a function to the contained value (if any). Arguments passed to `map_or` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use [`map_or_else`](enum.option#method.map_or_else), which is lazily evaluated. ##### Examples ``` let x = Some("foo"); assert_eq!(x.map_or(42, |v| v.len()), 3); let x: Option<&str> = None; assert_eq!(x.map_or(42, |v| v.len()), 42); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1014-1019)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn map\_or\_else<U, D, F>(self, default: D, f: F) -> Uwhere D: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> U, F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U, Computes a default function result (if none), or applies a different function to the contained value (if any). ##### Examples ``` let k = 21; let x = Some("foo"); assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 3); let x: Option<&str> = None; assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1051-1053)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn ok\_or<E>(self, err: E) -> Result<T, E> Transforms the `Option<T>` into a [`Result<T, E>`](../result/enum.result "Result<T, E>"), mapping [`Some(v)`](enum.option#variant.Some) to [`Ok(v)`](../result/enum.result#variant.Ok) and [`None`](enum.option#variant.None "None") to [`Err(err)`](../result/enum.result#variant.Err). Arguments passed to `ok_or` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use [`ok_or_else`](enum.option#method.ok_or_else), which is lazily evaluated. ##### Examples ``` let x = Some("foo"); assert_eq!(x.ok_or(0), Ok("foo")); let x: Option<&str> = None; assert_eq!(x.ok_or(0), Err(0)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1080-1083)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn ok\_or\_else<E, F>(self, err: F) -> Result<T, E>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> E, Transforms the `Option<T>` into a [`Result<T, E>`](../result/enum.result "Result<T, E>"), mapping [`Some(v)`](enum.option#variant.Some) to [`Ok(v)`](../result/enum.result#variant.Ok) and [`None`](enum.option#variant.None "None") to [`Err(err())`](../result/enum.result#variant.Err). ##### Examples ``` let x = Some("foo"); assert_eq!(x.ok_or_else(|| 0), Ok("foo")); let x: Option<&str> = None; assert_eq!(x.ok_or_else(|| 0), Err(0)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1107-1109)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn as\_deref(&self) -> Option<&<T as Deref>::Target>where T: [Deref](../ops/trait.deref "trait std::ops::Deref"), Converts from `Option<T>` (or `&Option<T>`) to `Option<&T::Target>`. Leaves the original Option in-place, creating a new one with a reference to the original one, additionally coercing the contents via [`Deref`](../ops/trait.deref "Deref"). ##### Examples ``` let x: Option<String> = Some("hey".to_owned()); assert_eq!(x.as_deref(), Some("hey")); let x: Option<String> = None; assert_eq!(x.as_deref(), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1133-1135)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn as\_deref\_mut(&mut self) -> Option<&mut <T as Deref>::Target>where T: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"), Converts from `Option<T>` (or `&mut Option<T>`) to `Option<&mut T::Target>`. Leaves the original `Option` in-place, creating a new one containing a mutable reference to the inner type’s [`Deref::Target`](../ops/trait.deref#associatedtype.Target "Deref::Target") type. ##### Examples ``` let mut x: Option<String> = Some("hey".to_owned()); assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), Some("HEY".to_owned().as_mut_str())); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1161)const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option") · #### pub fn iter(&self) -> Iter<'\_, T> Notable traits for [Iter](struct.iter "struct std::option::Iter")<'a, A> ``` impl<'a, A> Iterator for Iter<'a, A> type Item = &'a A; ``` Returns an iterator over the possibly contained value. ##### Examples ``` let x = Some(4); assert_eq!(x.iter().next(), Some(&4)); let x: Option<u32> = None; assert_eq!(x.iter().next(), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1182)#### pub fn iter\_mut(&mut self) -> IterMut<'\_, T> Notable traits for [IterMut](struct.itermut "struct std::option::IterMut")<'a, A> ``` impl<'a, A> Iterator for IterMut<'a, A> type Item = &'a mut A; ``` Returns a mutable iterator over the possibly contained value. ##### Examples ``` let mut x = Some(4); match x.iter_mut().next() { Some(v) => *v = 42, None => {}, } assert_eq!(x, Some(42)); let mut x: Option<u32> = None; assert_eq!(x.iter_mut().next(), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1220-1223)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn and<U>(self, optb: Option<U>) -> Option<U> Returns [`None`](enum.option#variant.None "None") if the option is [`None`](enum.option#variant.None "None"), otherwise returns `optb`. Arguments passed to `and` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use [`and_then`](enum.option#method.and_then), which is lazily evaluated. ##### Examples ``` let x = Some(2); let y: Option<&str> = None; assert_eq!(x.and(y), None); let x: Option<u32> = None; let y = Some("foo"); assert_eq!(x.and(y), None); let x = Some(2); let y = Some("foo"); assert_eq!(x.and(y), Some("foo")); let x: Option<u32> = None; let y: Option<&str> = None; assert_eq!(x.and(y), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1262-1265)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn and\_then<U, F>(self, f: F) -> Option<U>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> [Option](enum.option "enum std::option::Option")<U>, Returns [`None`](enum.option#variant.None "None") if the option is [`None`](enum.option#variant.None "None"), otherwise calls `f` with the wrapped value and returns the result. Some languages call this operation flatmap. ##### Examples ``` fn sq_then_to_string(x: u32) -> Option<String> { x.checked_mul(x).map(|sq| sq.to_string()) } assert_eq!(Some(2).and_then(sq_then_to_string), Some(4.to_string())); assert_eq!(Some(1_000_000).and_then(sq_then_to_string), None); // overflowed! assert_eq!(None.and_then(sq_then_to_string), None); ``` Often used to chain fallible operations that may return [`None`](enum.option#variant.None "None"). ``` let arr_2d = [["A0", "A1"], ["B0", "B1"]]; let item_0_1 = arr_2d.get(0).and_then(|row| row.get(1)); assert_eq!(item_0_1, Some(&"A1")); let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0)); assert_eq!(item_2_0, None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1300-1304)1.27.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn filter<P>(self, predicate: P) -> Option<T>where P: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&](../primitive.reference)T) -> [bool](../primitive.bool), Returns [`None`](enum.option#variant.None "None") if the option is [`None`](enum.option#variant.None "None"), otherwise calls `predicate` with the wrapped value and returns: * [`Some(t)`](enum.option#variant.Some) if `predicate` returns `true` (where `t` is the wrapped value), and * [`None`](enum.option#variant.None "None") if `predicate` returns `false`. This function works similar to [`Iterator::filter()`](../iter/trait.iterator#method.filter "Iterator::filter()"). You can imagine the `Option<T>` being an iterator over one or zero elements. `filter()` lets you decide which elements to keep. ##### Examples ``` fn is_even(n: &i32) -> bool { n % 2 == 0 } assert_eq!(None.filter(is_even), None); assert_eq!(Some(3).filter(is_even), None); assert_eq!(Some(4).filter(is_even), Some(4)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1344-1346)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn or(self, optb: Option<T>) -> Option<T> Returns the option if it contains a value, otherwise returns `optb`. Arguments passed to `or` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use [`or_else`](enum.option#method.or_else), which is lazily evaluated. ##### Examples ``` let x = Some(2); let y = None; assert_eq!(x.or(y), Some(2)); let x = None; let y = Some(100); assert_eq!(x.or(y), Some(100)); let x = Some(2); let y = Some(100); assert_eq!(x.or(y), Some(2)); let x: Option<u32> = None; let y = None; assert_eq!(x.or(y), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1370-1373)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn or\_else<F>(self, f: F) -> Option<T>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> [Option](enum.option "enum std::option::Option")<T>, Returns the option if it contains a value, otherwise calls `f` and returns the result. ##### Examples ``` fn nobody() -> Option<&'static str> { None } fn vikings() -> Option<&'static str> { Some("vikings") } assert_eq!(Some("barbarians").or_else(vikings), Some("barbarians")); assert_eq!(None.or_else(vikings), Some("vikings")); assert_eq!(None.or_else(nobody), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1405-1407)1.37.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn xor(self, optb: Option<T>) -> Option<T> Returns [`Some`](enum.option#variant.Some "Some") if exactly one of `self`, `optb` is [`Some`](enum.option#variant.Some "Some"), otherwise returns [`None`](enum.option#variant.None "None"). ##### Examples ``` let x = Some(2); let y: Option<u32> = None; assert_eq!(x.xor(y), Some(2)); let x: Option<u32> = None; let y = Some(2); assert_eq!(x.xor(y), Some(2)); let x = Some(2); let y = Some(2); assert_eq!(x.xor(y), None); let x: Option<u32> = None; let y: Option<u32> = None; assert_eq!(x.xor(y), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1443-1445)1.53.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn insert(&mut self, value: T) -> &mut T Inserts `value` into the option, then returns a mutable reference to it. If the option already contains a value, the old value is dropped. See also [`Option::get_or_insert`](enum.option#method.get_or_insert "Option::get_or_insert"), which doesn’t update the value if the option already contains [`Some`](enum.option#variant.Some "Some"). ##### Example ``` let mut opt = None; let val = opt.insert(1); assert_eq!(*val, 1); assert_eq!(opt.unwrap(), 1); let val = opt.insert(2); assert_eq!(*val, 2); *val = 3; assert_eq!(opt.unwrap(), 3); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1476-1478)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn get\_or\_insert(&mut self, value: T) -> &mut T Inserts `value` into the option if it is [`None`](enum.option#variant.None "None"), then returns a mutable reference to the contained value. See also [`Option::insert`](enum.option#method.insert "Option::insert"), which updates the value even if the option already contains [`Some`](enum.option#variant.Some "Some"). ##### Examples ``` let mut x = None; { let y: &mut u32 = x.get_or_insert(5); assert_eq!(y, &5); *y = 7; } assert_eq!(x, Some(7)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1511-1513)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn get\_or\_insert\_default(&mut self) -> &mut Twhere T: [Default](../default/trait.default "trait std::default::Default"), 🔬This is a nightly-only experimental API. (`option_get_or_insert_default` [#82901](https://github.com/rust-lang/rust/issues/82901)) Inserts the default value into the option if it is [`None`](enum.option#variant.None "None"), then returns a mutable reference to the contained value. ##### Examples ``` #![feature(option_get_or_insert_default)] let mut x = None; { let y: &mut u32 = x.get_or_insert_default(); assert_eq!(y, &0); *y = 7; } assert_eq!(x, Some(7)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1542-1545)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn get\_or\_insert\_with<F>(&mut self, f: F) -> &mut Twhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> T, Inserts a value computed from `f` into the option if it is [`None`](enum.option#variant.None "None"), then returns a mutable reference to the contained value. ##### Examples ``` let mut x = None; { let y: &mut u32 = x.get_or_insert_with(|| 5); assert_eq!(y, &5); *y = 7; } assert_eq!(x, Some(7)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1580)const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option") · #### pub fn take(&mut self) -> Option<T> Takes the value out of the option, leaving a [`None`](enum.option#variant.None "None") in its place. ##### Examples ``` let mut x = Some(2); let y = x.take(); assert_eq!(x, None); assert_eq!(y, Some(2)); let mut x: Option<u32> = None; let y = x.take(); assert_eq!(x, None); assert_eq!(y, None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1605)1.31.0 (const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option")) · #### pub fn replace(&mut self, value: T) -> Option<T> Replaces the actual value in the option by the value given in parameter, returning the old value if present, leaving a [`Some`](enum.option#variant.Some "Some") in its place without deinitializing either one. ##### Examples ``` let mut x = Some(2); let old = x.replace(5); assert_eq!(x, Some(5)); assert_eq!(old, Some(2)); let mut x = None; let old = x.replace(3); assert_eq!(x, Some(3)); assert_eq!(old, None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1629-1631)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn contains<U>(&self, x: &U) -> boolwhere U: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, 🔬This is a nightly-only experimental API. (`option_result_contains` [#62358](https://github.com/rust-lang/rust/issues/62358)) Returns `true` if the option is a [`Some`](enum.option#variant.Some "Some") value containing the given value. ##### Examples ``` #![feature(option_result_contains)] let x: Option<u32> = Some(2); assert_eq!(x.contains(&2), true); let x: Option<u32> = Some(3); assert_eq!(x.contains(&2), false); let x: Option<u32> = None; assert_eq!(x.contains(&2), false); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1656-1659)1.46.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)> Zips `self` with another `Option`. If `self` is `Some(s)` and `other` is `Some(o)`, this method returns `Some((s, o))`. Otherwise, `None` is returned. ##### Examples ``` let x = Some(1); let y = Some("hi"); let z = None::<u8>; assert_eq!(x.zip(y), Some((1, "hi"))); assert_eq!(x.zip(z), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1697-1702)const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext") · #### pub fn zip\_with<U, F, R>(self, other: Option<U>, f: F) -> Option<R>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T, U) -> R, 🔬This is a nightly-only experimental API. (`option_zip` [#70086](https://github.com/rust-lang/rust/issues/70086)) Zips `self` and another `Option` with function `f`. If `self` is `Some(s)` and `other` is `Some(o)`, this method returns `Some(f(s, o))`. Otherwise, `None` is returned. ##### Examples ``` #![feature(option_zip)] #[derive(Debug, PartialEq)] struct Point { x: f64, y: f64, } impl Point { fn new(x: f64, y: f64) -> Self { Self { x, y } } } let x = Some(17.5); let y = Some(42.7); assert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17.5, y: 42.7 })); assert_eq!(x.zip_with(None, Point::new), None); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1711)### impl<T, U> Option<(T, U)> [source](https://doc.rust-lang.org/src/core/option.rs.html#1730)#### pub const fn unzip(self) -> (Option<T>, Option<U>) 🔬This is a nightly-only experimental API. (`unzip_option` [#87800](https://github.com/rust-lang/rust/issues/87800)) Unzips an option containing a tuple of two options. If `self` is `Some((a, b))` this method returns `(Some(a), Some(b))`. Otherwise, `(None, None)` is returned. ##### Examples ``` #![feature(unzip_option)] let x = Some((1, "hi")); let y = None::<(u8, u32)>; assert_eq!(x.unzip(), (Some(1), Some("hi"))); assert_eq!(y.unzip(), (None, None)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1738)### impl<T> Option<&T> [source](https://doc.rust-lang.org/src/core/option.rs.html#1754-1756)1.35.0 (const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option")) · #### pub fn copied(self) -> Option<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), Maps an `Option<&T>` to an `Option<T>` by copying the contents of the option. ##### Examples ``` let x = 12; let opt_x = Some(&x); assert_eq!(opt_x, Some(&12)); let copied = opt_x.copied(); assert_eq!(copied, Some(12)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1781-1783)const: [unstable](https://github.com/rust-lang/rust/issues/91582 "Tracking issue for const_option_cloned") · #### pub fn cloned(self) -> Option<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), Maps an `Option<&T>` to an `Option<T>` by cloning the contents of the option. ##### Examples ``` let x = 12; let opt_x = Some(&x); assert_eq!(opt_x, Some(&12)); let cloned = opt_x.cloned(); assert_eq!(cloned, Some(12)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1792)### impl<T> Option<&mut T> [source](https://doc.rust-lang.org/src/core/option.rs.html#1808-1810)1.35.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91930 "Tracking issue for const_option_ext")) · #### pub fn copied(self) -> Option<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), Maps an `Option<&mut T>` to an `Option<T>` by copying the contents of the option. ##### Examples ``` let mut x = 12; let opt_x = Some(&mut x); assert_eq!(opt_x, Some(&mut 12)); let copied = opt_x.copied(); assert_eq!(copied, Some(12)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1833-1835)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91582 "Tracking issue for const_option_cloned")) · #### pub fn cloned(self) -> Option<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), Maps an `Option<&mut T>` to an `Option<T>` by cloning the contents of the option. ##### Examples ``` let mut x = 12; let opt_x = Some(&mut x); assert_eq!(opt_x, Some(&mut 12)); let cloned = opt_x.cloned(); assert_eq!(cloned, Some(12)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1844)### impl<T, E> Option<Result<T, E>> [source](https://doc.rust-lang.org/src/core/option.rs.html#1864)1.33.0 (const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option")) · #### pub fn transpose(self) -> Result<Option<T>, E> Transposes an `Option` of a [`Result`](../result/enum.result "Result") into a [`Result`](../result/enum.result "Result") of an `Option`. [`None`](enum.option#variant.None "None") will be mapped to `[Ok](../result/enum.result#variant.Ok "Ok")([None](enum.option#variant.None "None"))`. `[Some](enum.option#variant.Some "Some")([Ok](../result/enum.result#variant.Ok "Ok")(_))` and `[Some](enum.option#variant.Some "Some")([Err](../result/enum.result#variant.Err "Err")(_))` will be mapped to `[Ok](../result/enum.result#variant.Ok "Ok")([Some](enum.option#variant.Some "Some")(_))` and `[Err](../result/enum.result#variant.Err "Err")(_)`. ##### Examples ``` #[derive(Debug, Eq, PartialEq)] struct SomeErr; let x: Result<Option<i32>, SomeErr> = Ok(Some(5)); let y: Option<Result<i32, SomeErr>> = Some(Ok(5)); assert_eq!(x, y.transpose()); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#2328)### impl<T> Option<Option<T>> [source](https://doc.rust-lang.org/src/core/option.rs.html#2356)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/67441 "Tracking issue for const_option")) · #### pub fn flatten(self) -> Option<T> Converts from `Option<Option<T>>` to `Option<T>`. ##### Examples Basic usage: ``` let x: Option<Option<u32>> = Some(Some(6)); assert_eq!(Some(6), x.flatten()); let x: Option<Option<u32>> = Some(None); assert_eq!(None, x.flatten()); let x: Option<Option<u32>> = None; assert_eq!(None, x.flatten()); ``` Flattening only removes one level of nesting at a time: ``` let x: Option<Option<Option<u32>>> = Some(Some(Some(6))); assert_eq!(Some(Some(6)), x.flatten()); assert_eq!(Some(6), x.flatten().flatten()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/option.rs.html#1889)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T> Clone for Option<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/option.rs.html#1894)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> Option<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/option.rs.html#1902)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone\_from(&mut self, source: &Option<T>) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Debug for Option<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/option.rs.html#515)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/option.rs.html#1912)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#1922)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> Option<T> Returns [`None`](enum.option#variant.None "Option::None"). ##### Examples ``` let opt: Option<u32> = Option::default(); assert!(opt.is_none()); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1990)1.30.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<'a, T> From<&'a Option<T>> for Option<&'a T> [source](https://doc.rust-lang.org/src/core/option.rs.html#2011)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(o: &'a Option<T>) -> Option<&'a T> Converts from `&Option<T>` to `Option<&T>`. ##### Examples Converts an `[Option](enum.option "Option")<[String](../string/struct.string "String")>` into an `[Option](enum.option "Option")<[usize](../primitive.usize "usize")>`, preserving the original. The [`map`](enum.option#method.map) method takes the `self` argument by value, consuming the original, so this technique uses `from` to first take an [`Option`](enum.option "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)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#2018)1.30.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T> [source](https://doc.rust-lang.org/src/core/option.rs.html#2034)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(o: &'a mut Option<T>) -> Option<&'a mut T> 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!"))); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#1973)1.12.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<T> From<T> for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#1983)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(val: T) -> Option<T> Moves `val` into a new [`Some`](enum.option#variant.Some "Some"). ##### Examples ``` let o: Option<u8> = Option::from(67); assert_eq!(Some(67), o); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#2214)### impl<A, V> FromIterator<Option<A>> for Option<V>where V: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<A>, [source](https://doc.rust-lang.org/src/core/option.rs.html#2276)#### fn from\_iter<I>(iter: I) -> Option<V>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [Option](enum.option "enum std::option::Option")<A>>, Takes each element in the [`Iterator`](../iter/trait.iterator "Iterator"): if it is [`None`](enum.option#variant.None "Option::None"), no further elements are taken, and the [`None`](enum.option#variant.None "Option::None") is returned. Should no [`None`](enum.option#variant.None "Option::None") occur, a container of type `V` containing the values of each [`Option`](enum.option "Option") is returned. ##### Examples Here is an example which increments every integer in a vector. We use the checked variant of `add` that returns `None` when the calculation would result in an overflow. ``` let items = vec![0_u16, 1, 2]; let res: Option<Vec<u16>> = items .iter() .map(|x| x.checked_add(1)) .collect(); assert_eq!(res, Some(vec![1, 2, 3])); ``` As you can see, this will return the expected, valid items. Here is another example that tries to subtract one from another list of integers, this time checking for underflow: ``` let items = vec![2_u16, 1, 0]; let res: Option<Vec<u16>> = items .iter() .map(|x| x.checked_sub(1)) .collect(); assert_eq!(res, None); ``` Since the last element is zero, it would underflow. Thus, the resulting value is `None`. Here is a variation on the previous example, showing that no further elements are taken from `iter` after the first `None`. ``` let items = vec![3_u16, 2, 1, 10]; let mut shared = 0; let res: Option<Vec<u16>> = items .iter() .map(|x| { shared += x; x.checked_sub(2) }) .collect(); assert_eq!(res, None); assert_eq!(shared, 6); ``` Since the third element caused an underflow, no further elements were taken, so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16. [source](https://doc.rust-lang.org/src/core/option.rs.html#2306)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> FromResidual<<Option<T> as Try>::Residual> for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#2308)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from\_residual(residual: Option<Infallible>) -> Option<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/option.rs.html#2316)### impl<T> FromResidual<Yeet<()>> for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#2318)#### fn from\_residual(Yeet<()>) -> Option<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Hash for Option<T>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/option.rs.html#515)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/option.rs.html#1952)1.4.0 · ### impl<'a, T> IntoIterator for &'a Option<T> #### type Item = &'a T The type of the elements being iterated over. #### type IntoIter = Iter<'a, T> Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/option.rs.html#1956)#### fn into\_iter(self) -> Iter<'a, T> Notable traits for [Iter](struct.iter "struct std::option::Iter")<'a, A> ``` impl<'a, A> Iterator for Iter<'a, A> type Item = &'a A; ``` Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/option.rs.html#1962)1.4.0 · ### impl<'a, T> IntoIterator for &'a mut Option<T> #### type Item = &'a mut T The type of the elements being iterated over. #### type IntoIter = IterMut<'a, T> Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/option.rs.html#1966)#### fn into\_iter(self) -> IterMut<'a, T> Notable traits for [IterMut](struct.itermut "struct std::option::IterMut")<'a, A> ``` impl<'a, A> Iterator for IterMut<'a, A> type Item = &'a mut A; ``` Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/option.rs.html#1928)### impl<T> IntoIterator for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#1946)#### fn into\_iter(self) -> IntoIter<T> Notable traits for [IntoIter](struct.intoiter "struct std::option::IntoIter")<A> ``` impl<A> Iterator for IntoIter<A> type Item = A; ``` Returns a consuming iterator over the possibly contained value. ##### Examples ``` let x = Some("string"); let v: Vec<&str> = x.into_iter().collect(); assert_eq!(v, ["string"]); let x = None; let v: Vec<&str> = x.into_iter().collect(); assert!(v.is_empty()); ``` #### type Item = T The type of the elements being iterated over. #### type IntoIter = IntoIter<T> Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Ord for Option<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/option.rs.html#515)#### fn cmp(&self, other: &Option<T>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> PartialEq<Option<T>> for Option<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [source](https://doc.rust-lang.org/src/core/option.rs.html#515)#### fn eq(&self, other: &Option<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> PartialOrd<Option<T>> for Option<T>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, [source](https://doc.rust-lang.org/src/core/option.rs.html#515)#### fn partial\_cmp(&self, other: &Option<T>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#218)1.37.0 · ### impl<T, U> Product<Option<U>> for Option<T>where T: [Product](../iter/trait.product "trait std::iter::Product")<U>, [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#225-227)#### fn product<I>(iter: I) -> Option<T>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Option](enum.option "enum std::option::Option")<U>>, Takes each element in the [`Iterator`](../iter/trait.iterator "Iterator"): if it is a [`None`](enum.option#variant.None "None"), no further elements are taken, and the [`None`](enum.option#variant.None "None") is returned. Should no [`None`](enum.option#variant.None "None") occur, the product of all elements is returned. [source](https://doc.rust-lang.org/src/core/option.rs.html#2324)### impl<T> Residual<T> for Option<Infallible> #### type TryType = Option<T> 🔬This is a nightly-only experimental API. (`try_trait_v2_residual` [#91285](https://github.com/rust-lang/rust/issues/91285)) The “return” type of this meta-function. [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#191)1.37.0 · ### impl<T, U> Sum<Option<U>> for Option<T>where T: [Sum](../iter/trait.sum "trait std::iter::Sum")<U>, [source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#209-211)#### fn sum<I>(iter: I) -> Option<T>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Option](enum.option "enum std::option::Option")<U>>, Takes each element in the [`Iterator`](../iter/trait.iterator "Iterator"): if it is a [`None`](enum.option#variant.None "None"), no further elements are taken, and the [`None`](enum.option#variant.None "None") is returned. Should no [`None`](enum.option#variant.None "None") occur, the sum of all elements is returned. ##### Examples This sums up the position of the character ‘a’ in a vector of strings, if a word did not have the character ‘a’ the operation returns `None`: ``` let words = vec!["have", "a", "great", "day"]; let total: Option<usize> = words.iter().map(|w| w.find('a')).sum(); assert_eq!(total, Some(5)); ``` [source](https://doc.rust-lang.org/src/core/option.rs.html#2286)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> Try for Option<T> #### type Output = T 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value produced by `?` when *not* short-circuiting. #### type Residual = Option<Infallible> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value passed to [`FromResidual::from_residual`](../ops/trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") as part of `?` when short-circuiting. [Read more](../ops/trait.try#associatedtype.Residual) [source](https://doc.rust-lang.org/src/core/option.rs.html#2291)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from\_output(output: <Option<T> as Try>::Output) -> Option<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from its `Output` type. [Read more](../ops/trait.try#tymethod.from_output) [source](https://doc.rust-lang.org/src/core/option.rs.html#2296)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn branch( self) -> ControlFlow<<Option<T> as Try>::Residual, <Option<T> as Try>::Output> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used in `?` to decide whether the operator should produce a value (because this returned [`ControlFlow::Continue`](../ops/enum.controlflow#variant.Continue "ControlFlow::Continue")) or propagate a value back to the caller (because this returned [`ControlFlow::Break`](../ops/enum.controlflow#variant.Break "ControlFlow::Break")). [Read more](../ops/trait.try#tymethod.branch) [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Copy for Option<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Eq for Option<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> StructuralEq for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> StructuralPartialEq for Option<T> Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Option<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Option<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Option<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Option<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Option<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::option::Iter Struct std::option::Iter ======================== ``` pub struct Iter<'a, A>where    A: 'a,{ /* private fields */ } ``` An iterator over a reference to the [`Some`](enum.option#variant.Some "Some") variant of an [`Option`](enum.option "Option"). The iterator yields one value if the [`Option`](enum.option "Option") is a [`Some`](enum.option#variant.Some "Some"), otherwise none. This `struct` is created by the [`Option::iter`](enum.option#method.iter "Option::iter") function. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/option.rs.html#2119)### impl<A> Clone for Iter<'\_, A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2121)#### fn clone(&self) -> Iter<'\_, A> Notable traits for [Iter](struct.iter "struct std::option::Iter")<'a, A> ``` impl<'a, A> Iterator for Iter<'a, A> type Item = &'a A; ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/option.rs.html#2082)### impl<'a, A> Debug for Iter<'a, A>where A: 'a + [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/option.rs.html#2082)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/option.rs.html#2102)### impl<'a, A> DoubleEndedIterator for Iter<'a, A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2104)#### fn next\_back(&mut self) -> Option<&'a A> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/core/option.rs.html#2110)### impl<A> ExactSizeIterator for Iter<'\_, A> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/option.rs.html#2088)### impl<'a, A> Iterator for Iter<'a, A> #### type Item = &'a A The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/core/option.rs.html#2092)#### fn next(&mut self) -> Option<&'a A> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/option.rs.html#2096)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)#### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3312-3314)#### fn cycle(self) -> Cycle<Self>where Self: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Cycle](../iter/struct.cycle "struct std::iter::Cycle")<I> ``` impl<I> Iterator for Cycle<I>where     I: Clone + Iterator, type Item = <I as Iterator>::Item; ``` Repeats an iterator endlessly. [Read more](../iter/trait.iterator#method.cycle) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/core/option.rs.html#2113)1.26.0 · ### impl<A> FusedIterator for Iter<'\_, A> [source](https://doc.rust-lang.org/src/core/option.rs.html#2116)### impl<A> TrustedLen for Iter<'\_, A> Auto Trait Implementations -------------------------- ### impl<'a, A> RefUnwindSafe for Iter<'a, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, A> Send for Iter<'a, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<'a, A> Sync for Iter<'a, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<'a, A> Unpin for Iter<'a, A> ### impl<'a, A> UnwindSafe for Iter<'a, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Constant std::time::UNIX_EPOCH Constant std::time::UNIX\_EPOCH =============================== ``` pub const UNIX_EPOCH: SystemTime; ``` An anchor in time which can be used to create new `SystemTime` instances or learn about where in time a `SystemTime` lies. This constant is defined to be “1970-01-01 00:00:00 UTC” on all systems with respect to the system clock. Using `duration_since` on an existing [`SystemTime`](struct.systemtime "SystemTime") instance can tell how far away from this point in time a measurement lies, and using `UNIX_EPOCH + duration` can be used to create a [`SystemTime`](struct.systemtime "SystemTime") instance to represent another fixed point in time. Examples -------- ``` use std::time::{SystemTime, UNIX_EPOCH}; match SystemTime::now().duration_since(UNIX_EPOCH) { Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()), Err(_) => panic!("SystemTime before UNIX EPOCH!"), } ``` rust Module std::time Module std::time ================ Temporal quantification. Examples: --------- There are multiple ways to create a new [`Duration`](struct.duration "Duration"): ``` let five_seconds = Duration::from_secs(5); assert_eq!(five_seconds, Duration::from_millis(5_000)); assert_eq!(five_seconds, Duration::from_micros(5_000_000)); assert_eq!(five_seconds, Duration::from_nanos(5_000_000_000)); let ten_seconds = Duration::from_secs(10); let seven_nanos = Duration::from_nanos(7); let total = ten_seconds + seven_nanos; assert_eq!(total, Duration::new(10, 7)); ``` Using [`Instant`](struct.instant "Instant") to calculate how long a function took to run: ⓘ ``` let now = Instant::now(); // Calling a slow function, it may take a while slow_function(); let elapsed_time = now.elapsed(); println!("Running slow_function() took {} seconds.", elapsed_time.as_secs()); ``` Structs ------- [FromFloatSecsError](struct.fromfloatsecserror "std::time::FromFloatSecsError struct")Experimental An error which can be returned when converting a floating-point value of seconds into a [`Duration`](struct.duration "Duration"). [Duration](struct.duration "std::time::Duration struct") A `Duration` type to represent a span of time, typically used for system timeouts. [Instant](struct.instant "std::time::Instant struct") A measurement of a monotonically nondecreasing clock. Opaque and useful only with [`Duration`](struct.duration "Duration"). [SystemTime](struct.systemtime "std::time::SystemTime struct") A measurement of the system clock, useful for talking to external entities like the file system or other processes. [SystemTimeError](struct.systemtimeerror "std::time::SystemTimeError struct") An error returned from the `duration_since` and `elapsed` methods on `SystemTime`, used to learn how far in the opposite direction a system time lies. Constants --------- [UNIX\_EPOCH](constant.unix_epoch "std::time::UNIX_EPOCH constant") An anchor in time which can be used to create new `SystemTime` instances or learn about where in time a `SystemTime` lies. rust Struct std::time::SystemTimeError Struct std::time::SystemTimeError ================================= ``` pub struct SystemTimeError(_); ``` An error returned from the `duration_since` and `elapsed` methods on `SystemTime`, used to learn how far in the opposite direction a system time lies. Examples -------- ``` use std::thread::sleep; use std::time::{Duration, SystemTime}; let sys_time = SystemTime::now(); sleep(Duration::from_secs(1)); let new_sys_time = SystemTime::now(); match sys_time.duration_since(new_sys_time) { Ok(_) => {} Err(e) => println!("SystemTimeError difference: {:?}", e.duration()), } ``` Implementations --------------- [source](https://doc.rust-lang.org/src/std/time.rs.html#640-667)### impl SystemTimeError [source](https://doc.rust-lang.org/src/std/time.rs.html#664-666)#### pub fn duration(&self) -> Duration Returns the positive duration which represents how far forward the second system time was from the first. A `SystemTimeError` is returned from the [`SystemTime::duration_since`](struct.systemtime#method.duration_since "SystemTime::duration_since") and [`SystemTime::elapsed`](struct.systemtime#method.elapsed "SystemTime::elapsed") methods whenever the second system time represents a point later in time than the `self` of the method call. ##### Examples ``` use std::thread::sleep; use std::time::{Duration, SystemTime}; let sys_time = SystemTime::now(); sleep(Duration::from_secs(1)); let new_sys_time = SystemTime::now(); match sys_time.duration_since(new_sys_time) { Ok(_) => {} Err(e) => println!("SystemTimeError difference: {:?}", e.duration()), } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/time.rs.html#259)### impl Clone for SystemTimeError [source](https://doc.rust-lang.org/src/std/time.rs.html#259)#### fn clone(&self) -> SystemTimeError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/time.rs.html#259)### impl Debug for SystemTimeError [source](https://doc.rust-lang.org/src/std/time.rs.html#259)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/time.rs.html#678-682)### impl Display for SystemTimeError [source](https://doc.rust-lang.org/src/std/time.rs.html#679-681)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/time.rs.html#670-675)### impl Error for SystemTimeError [source](https://doc.rust-lang.org/src/std/time.rs.html#672-674)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for SystemTimeError ### impl Send for SystemTimeError ### impl Sync for SystemTimeError ### impl Unpin for SystemTimeError ### impl UnwindSafe for SystemTimeError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::time::FromFloatSecsError Struct std::time::FromFloatSecsError ==================================== ``` pub struct FromFloatSecsError { /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`duration_checked_float` [#83400](https://github.com/rust-lang/rust/issues/83400)) An error which can be returned when converting a floating-point value of seconds into a [`Duration`](struct.duration "Duration"). This error is used as the error type for [`Duration::try_from_secs_f32`](struct.duration#method.try_from_secs_f32 "Duration::try_from_secs_f32") and [`Duration::try_from_secs_f64`](struct.duration#method.try_from_secs_f64 "Duration::try_from_secs_f64"). Example ------- ``` #![feature(duration_checked_float)] use std::time::Duration; if let Err(e) = Duration::try_from_secs_f32(-1.0) { println!("Failed conversion to Duration: {e}"); } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl Clone for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)#### fn clone(&self) -> FromFloatSecsError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl Debug for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/time.rs.html#1230)### impl Display for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/time.rs.html#1231)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/error.rs.html#497)### impl Error for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#109)1.0.0 · #### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl PartialEq<FromFloatSecsError> for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)#### fn eq(&self, other: &FromFloatSecsError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl Eq for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl StructuralEq for FromFloatSecsError [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl StructuralPartialEq for FromFloatSecsError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for FromFloatSecsError ### impl Send for FromFloatSecsError ### impl Sync for FromFloatSecsError ### impl Unpin for FromFloatSecsError ### impl UnwindSafe for FromFloatSecsError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::time::Duration Struct std::time::Duration ========================== ``` pub struct Duration { /* private fields */ } ``` A `Duration` type to represent a span of time, typically used for system timeouts. Each `Duration` is composed of a whole number of seconds and a fractional part represented in nanoseconds. If the underlying system does not support nanosecond-level precision, APIs binding a system timeout will typically round up the number of nanoseconds. [`Duration`](struct.duration "Duration")s implement many common traits, including [`Add`](../ops/trait.add "Add"), [`Sub`](../ops/trait.sub "Sub"), and other [`ops`](../ops/index) traits. It implements [`Default`](../default/trait.default "Default") by returning a zero-length `Duration`. Examples -------- ``` use std::time::Duration; let five_seconds = Duration::new(5, 0); let five_seconds_and_five_nanos = five_seconds + Duration::new(0, 5); assert_eq!(five_seconds_and_five_nanos.as_secs(), 5); assert_eq!(five_seconds_and_five_nanos.subsec_nanos(), 5); let ten_millis = Duration::from_millis(10); ``` Formatting `Duration` values ---------------------------- `Duration` intentionally does not have a `Display` impl, as there are a variety of ways to format spans of time for human readability. `Duration` provides a `Debug` impl that shows the full precision of the value. The `Debug` output uses the non-ASCII “µs” suffix for microseconds. If your program output may appear in contexts that cannot rely on full Unicode compatibility, you may wish to format `Duration` objects yourself or use a crate to do so. Implementations --------------- [source](https://doc.rust-lang.org/src/core/time.rs.html#77)### impl Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#89)#### pub const SECOND: Duration = Duration::from\_secs(1) 🔬This is a nightly-only experimental API. (`duration_constants` [#57391](https://github.com/rust-lang/rust/issues/57391)) The duration of one second. ##### Examples ``` #![feature(duration_constants)] use std::time::Duration; assert_eq!(Duration::SECOND, Duration::from_secs(1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#102)#### pub const MILLISECOND: Duration = Duration::from\_millis(1) 🔬This is a nightly-only experimental API. (`duration_constants` [#57391](https://github.com/rust-lang/rust/issues/57391)) The duration of one millisecond. ##### Examples ``` #![feature(duration_constants)] use std::time::Duration; assert_eq!(Duration::MILLISECOND, Duration::from_millis(1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#115)#### pub const MICROSECOND: Duration = Duration::from\_micros(1) 🔬This is a nightly-only experimental API. (`duration_constants` [#57391](https://github.com/rust-lang/rust/issues/57391)) The duration of one microsecond. ##### Examples ``` #![feature(duration_constants)] use std::time::Duration; assert_eq!(Duration::MICROSECOND, Duration::from_micros(1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#128)#### pub const NANOSECOND: Duration = Duration::from\_nanos(1) 🔬This is a nightly-only experimental API. (`duration_constants` [#57391](https://github.com/rust-lang/rust/issues/57391)) The duration of one nanosecond. ##### Examples ``` #![feature(duration_constants)] use std::time::Duration; assert_eq!(Duration::NANOSECOND, Duration::from_nanos(1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#142)1.53.0 · #### pub const ZERO: Duration = Duration::from\_nanos(0) A duration of zero time. ##### Examples ``` use std::time::Duration; let duration = Duration::ZERO; assert!(duration.is_zero()); assert_eq!(duration.as_nanos(), 0); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#161)1.53.0 · #### pub const MAX: Duration = Duration::new(u64::MAX, NANOS\_PER\_SEC - 1) The maximum duration. May vary by platform as necessary. Must be able to contain the difference between two instances of [`Instant`](struct.instant) or two instances of [`SystemTime`](struct.systemtime). This constraint gives it a value of about 584,942,417,355 years in practice, which is currently used on all platforms. ##### Examples ``` use std::time::Duration; assert_eq!(Duration::MAX, Duration::new(u64::MAX, 1_000_000_000 - 1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#185)const: 1.58.0 · #### pub const fn new(secs: u64, nanos: u32) -> Duration Creates a new `Duration` from the specified number of whole seconds and additional nanoseconds. If the number of nanoseconds is greater than 1 billion (the number of nanoseconds in a second), then it will carry over into the seconds provided. ##### Panics This constructor will panic if the carry from the nanoseconds overflows the seconds counter. ##### Examples ``` use std::time::Duration; let five_seconds = Duration::new(5, 0); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#210)const: 1.32.0 · #### pub const fn from\_secs(secs: u64) -> Duration Creates a new `Duration` from the specified number of whole seconds. ##### Examples ``` use std::time::Duration; let duration = Duration::from_secs(5); assert_eq!(5, duration.as_secs()); assert_eq!(0, duration.subsec_nanos()); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#230)const: 1.32.0 · #### pub const fn from\_millis(millis: u64) -> Duration Creates a new `Duration` from the specified number of milliseconds. ##### Examples ``` use std::time::Duration; let duration = Duration::from_millis(2569); assert_eq!(2, duration.as_secs()); assert_eq!(569_000_000, duration.subsec_nanos()); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#253)1.27.0 (const: 1.32.0) · #### pub const fn from\_micros(micros: u64) -> Duration Creates a new `Duration` from the specified number of microseconds. ##### Examples ``` use std::time::Duration; let duration = Duration::from_micros(1_000_002); assert_eq!(1, duration.as_secs()); assert_eq!(2000, duration.subsec_nanos()); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#276)1.27.0 (const: 1.32.0) · #### pub const fn from\_nanos(nanos: u64) -> Duration Creates a new `Duration` from the specified number of nanoseconds. ##### Examples ``` use std::time::Duration; let duration = Duration::from_nanos(1_000_000_123); assert_eq!(1, duration.as_secs()); assert_eq!(123, duration.subsec_nanos()); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#303)1.53.0 (const: 1.53.0) · #### pub const fn is\_zero(&self) -> bool Returns true if this `Duration` spans no time. ##### Examples ``` use std::time::Duration; assert!(Duration::ZERO.is_zero()); assert!(Duration::new(0, 0).is_zero()); assert!(Duration::from_nanos(0).is_zero()); assert!(Duration::from_secs(0).is_zero()); assert!(!Duration::new(1, 1).is_zero()); assert!(!Duration::from_nanos(1).is_zero()); assert!(!Duration::from_secs(1).is_zero()); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#331)const: 1.32.0 · #### pub const fn as\_secs(&self) -> u64 Returns the number of *whole* seconds contained by this `Duration`. The returned value does not include the fractional (nanosecond) part of the duration, which can be obtained using [`subsec_nanos`](struct.duration#method.subsec_nanos). ##### Examples ``` use std::time::Duration; let duration = Duration::new(5, 730023852); assert_eq!(duration.as_secs(), 5); ``` To determine the total number of seconds represented by the `Duration` including the fractional part, use [`as_secs_f64`](struct.duration#method.as_secs_f64) or [`as_secs_f32`](struct.duration#method.as_secs_f32) [source](https://doc.rust-lang.org/src/core/time.rs.html#354)1.27.0 (const: 1.32.0) · #### pub const fn subsec\_millis(&self) -> u32 Returns the fractional part of this `Duration`, in whole milliseconds. This method does **not** return the length of the duration when represented by milliseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one thousand). ##### Examples ``` use std::time::Duration; let duration = Duration::from_millis(5432); assert_eq!(duration.as_secs(), 5); assert_eq!(duration.subsec_millis(), 432); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#377)1.27.0 (const: 1.32.0) · #### pub const fn subsec\_micros(&self) -> u32 Returns the fractional part of this `Duration`, in whole microseconds. This method does **not** return the length of the duration when represented by microseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one million). ##### Examples ``` use std::time::Duration; let duration = Duration::from_micros(1_234_567); assert_eq!(duration.as_secs(), 1); assert_eq!(duration.subsec_micros(), 234_567); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#400)const: 1.32.0 · #### pub const fn subsec\_nanos(&self) -> u32 Returns the fractional part of this `Duration`, in nanoseconds. This method does **not** return the length of the duration when represented by nanoseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one billion). ##### Examples ``` use std::time::Duration; let duration = Duration::from_millis(5010); assert_eq!(duration.as_secs(), 5); assert_eq!(duration.subsec_nanos(), 10_000_000); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#418)1.33.0 (const: 1.33.0) · #### pub const fn as\_millis(&self) -> u128 Returns the total number of whole milliseconds contained by this `Duration`. ##### Examples ``` use std::time::Duration; let duration = Duration::new(5, 730023852); assert_eq!(duration.as_millis(), 5730); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#436)1.33.0 (const: 1.33.0) · #### pub const fn as\_micros(&self) -> u128 Returns the total number of whole microseconds contained by this `Duration`. ##### Examples ``` use std::time::Duration; let duration = Duration::new(5, 730023852); assert_eq!(duration.as_micros(), 5730023); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#454)1.33.0 (const: 1.33.0) · #### pub const fn as\_nanos(&self) -> u128 Returns the total number of nanoseconds contained by this `Duration`. ##### Examples ``` use std::time::Duration; let duration = Duration::new(5, 730023852); assert_eq!(duration.as_nanos(), 5730023852); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#476)1.16.0 (const: 1.58.0) · #### pub const fn checked\_add(self, rhs: Duration) -> Option<Duration> Checked `Duration` addition. Computes `self + other`, returning [`None`](../option/enum.option#variant.None "None") if overflow occurred. ##### Examples Basic usage: ``` use std::time::Duration; assert_eq!(Duration::new(0, 0).checked_add(Duration::new(0, 1)), Some(Duration::new(0, 1))); assert_eq!(Duration::new(1, 0).checked_add(Duration::new(u64::MAX, 0)), None); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#511)1.53.0 (const: 1.58.0) · #### pub const fn saturating\_add(self, rhs: Duration) -> Duration Saturating `Duration` addition. Computes `self + other`, returning [`Duration::MAX`](struct.duration#associatedconstant.MAX "Duration::MAX") if overflow occurred. ##### Examples ``` #![feature(duration_constants)] use std::time::Duration; assert_eq!(Duration::new(0, 0).saturating_add(Duration::new(0, 1)), Duration::new(0, 1)); assert_eq!(Duration::new(1, 0).saturating_add(Duration::new(u64::MAX, 0)), Duration::MAX); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#536)1.16.0 (const: 1.58.0) · #### pub const fn checked\_sub(self, rhs: Duration) -> Option<Duration> Checked `Duration` subtraction. Computes `self - other`, returning [`None`](../option/enum.option#variant.None "None") if the result would be negative or if overflow occurred. ##### Examples Basic usage: ``` use std::time::Duration; assert_eq!(Duration::new(0, 1).checked_sub(Duration::new(0, 0)), Some(Duration::new(0, 1))); assert_eq!(Duration::new(0, 0).checked_sub(Duration::new(0, 1)), None); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#569)1.53.0 (const: 1.58.0) · #### pub const fn saturating\_sub(self, rhs: Duration) -> Duration Saturating `Duration` subtraction. Computes `self - other`, returning [`Duration::ZERO`](struct.duration#associatedconstant.ZERO "Duration::ZERO") if the result would be negative or if overflow occurred. ##### Examples ``` use std::time::Duration; assert_eq!(Duration::new(0, 1).saturating_sub(Duration::new(0, 0)), Duration::new(0, 1)); assert_eq!(Duration::new(0, 0).saturating_sub(Duration::new(0, 1)), Duration::ZERO); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#594)1.16.0 (const: 1.58.0) · #### pub const fn checked\_mul(self, rhs: u32) -> Option<Duration> Checked `Duration` multiplication. Computes `self * other`, returning [`None`](../option/enum.option#variant.None "None") if overflow occurred. ##### Examples Basic usage: ``` use std::time::Duration; assert_eq!(Duration::new(0, 500_000_001).checked_mul(2), Some(Duration::new(1, 2))); assert_eq!(Duration::new(u64::MAX - 1, 0).checked_mul(2), None); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#625)1.53.0 (const: 1.58.0) · #### pub const fn saturating\_mul(self, rhs: u32) -> Duration Saturating `Duration` multiplication. Computes `self * other`, returning [`Duration::MAX`](struct.duration#associatedconstant.MAX "Duration::MAX") if overflow occurred. ##### Examples ``` #![feature(duration_constants)] use std::time::Duration; assert_eq!(Duration::new(0, 500_000_001).saturating_mul(2), Duration::new(1, 2)); assert_eq!(Duration::new(u64::MAX - 1, 0).saturating_mul(2), Duration::MAX); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#651)1.16.0 (const: 1.58.0) · #### pub const fn checked\_div(self, rhs: u32) -> Option<Duration> Checked `Duration` division. Computes `self / other`, returning [`None`](../option/enum.option#variant.None "None") if `other == 0`. ##### Examples Basic usage: ``` use std::time::Duration; assert_eq!(Duration::new(2, 0).checked_div(2), Some(Duration::new(1, 0))); assert_eq!(Duration::new(1, 0).checked_div(2), Some(Duration::new(0, 500_000_000))); assert_eq!(Duration::new(2, 0).checked_div(0), None); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#679)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn as\_secs\_f64(&self) -> f64 Returns the number of seconds contained by this `Duration` as `f64`. The returned value does include the fractional (nanosecond) part of the duration. ##### Examples ``` use std::time::Duration; let dur = Duration::new(2, 700_000_000); assert_eq!(dur.as_secs_f64(), 2.7); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#698)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn as\_secs\_f32(&self) -> f32 Returns the number of seconds contained by this `Duration` as `f32`. The returned value does include the fractional (nanosecond) part of the duration. ##### Examples ``` use std::time::Duration; let dur = Duration::new(2, 700_000_000); assert_eq!(dur.as_secs_f32(), 2.7); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#733)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn from\_secs\_f64(secs: f64) -> Duration Creates a new `Duration` from the specified number of seconds represented as `f64`. ##### Panics This constructor will panic if `secs` is negative, overflows `Duration` or not finite. ##### Examples ``` use std::time::Duration; let res = Duration::from_secs_f64(0.0); assert_eq!(res, Duration::new(0, 0)); let res = Duration::from_secs_f64(1e-20); assert_eq!(res, Duration::new(0, 0)); let res = Duration::from_secs_f64(4.2e-7); assert_eq!(res, Duration::new(0, 420)); let res = Duration::from_secs_f64(2.7); assert_eq!(res, Duration::new(2, 700_000_000)); let res = Duration::from_secs_f64(3e10); assert_eq!(res, Duration::new(30_000_000_000, 0)); // subnormal float let res = Duration::from_secs_f64(f64::from_bits(1)); assert_eq!(res, Duration::new(0, 0)); // conversion uses rounding let res = Duration::from_secs_f64(0.999e-9); assert_eq!(res, Duration::new(0, 1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#771)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn from\_secs\_f32(secs: f32) -> Duration Creates a new `Duration` from the specified number of seconds represented as `f32`. ##### Panics This constructor will panic if `secs` is negative, overflows `Duration` or not finite. ##### Examples ``` use std::time::Duration; let res = Duration::from_secs_f32(0.0); assert_eq!(res, Duration::new(0, 0)); let res = Duration::from_secs_f32(1e-20); assert_eq!(res, Duration::new(0, 0)); let res = Duration::from_secs_f32(4.2e-7); assert_eq!(res, Duration::new(0, 420)); let res = Duration::from_secs_f32(2.7); assert_eq!(res, Duration::new(2, 700_000_048)); let res = Duration::from_secs_f32(3e10); assert_eq!(res, Duration::new(30_000_001_024, 0)); // subnormal float let res = Duration::from_secs_f32(f32::from_bits(1)); assert_eq!(res, Duration::new(0, 0)); // conversion uses rounding let res = Duration::from_secs_f32(0.999e-9); assert_eq!(res, Duration::new(0, 1)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#796)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn mul\_f64(self, rhs: f64) -> Duration Multiplies `Duration` by `f64`. ##### Panics This method will panic if result is negative, overflows `Duration` or not finite. ##### Examples ``` use std::time::Duration; let dur = Duration::new(2, 700_000_000); assert_eq!(dur.mul_f64(3.14), Duration::new(8, 478_000_000)); assert_eq!(dur.mul_f64(3.14e5), Duration::new(847_800, 0)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#818)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn mul\_f32(self, rhs: f32) -> Duration Multiplies `Duration` by `f32`. ##### Panics This method will panic if result is negative, overflows `Duration` or not finite. ##### Examples ``` use std::time::Duration; let dur = Duration::new(2, 700_000_000); assert_eq!(dur.mul_f32(3.14), Duration::new(8, 478_000_641)); assert_eq!(dur.mul_f32(3.14e5), Duration::new(847800, 0)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#840)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn div\_f64(self, rhs: f64) -> Duration Divide `Duration` by `f64`. ##### Panics This method will panic if result is negative, overflows `Duration` or not finite. ##### Examples ``` use std::time::Duration; let dur = Duration::new(2, 700_000_000); assert_eq!(dur.div_f64(3.14), Duration::new(0, 859_872_611)); assert_eq!(dur.div_f64(3.14e5), Duration::new(0, 8_599)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#864)1.38.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float")) · #### pub fn div\_f32(self, rhs: f32) -> Duration Divide `Duration` by `f32`. ##### Panics This method will panic if result is negative, overflows `Duration` or not finite. ##### Examples ``` use std::time::Duration; let dur = Duration::new(2, 700_000_000); // note that due to rounding errors result is slightly // different from 0.859_872_611 assert_eq!(dur.div_f32(3.14), Duration::new(0, 859_872_580)); assert_eq!(dur.div_f32(3.14e5), Duration::new(0, 8_599)); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#884)const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float") · #### pub fn div\_duration\_f64(self, rhs: Duration) -> f64 🔬This is a nightly-only experimental API. (`div_duration` [#63139](https://github.com/rust-lang/rust/issues/63139)) Divide `Duration` by `Duration` and return `f64`. ##### Examples ``` #![feature(div_duration)] use std::time::Duration; let dur1 = Duration::new(2, 700_000_000); let dur2 = Duration::new(5, 400_000_000); assert_eq!(dur1.div_duration_f64(dur2), 0.5); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#904)const: [unstable](https://github.com/rust-lang/rust/issues/72440 "Tracking issue for duration_consts_float") · #### pub fn div\_duration\_f32(self, rhs: Duration) -> f32 🔬This is a nightly-only experimental API. (`div_duration` [#63139](https://github.com/rust-lang/rust/issues/63139)) Divide `Duration` by `Duration` and return `f32`. ##### Examples ``` #![feature(div_duration)] use std::time::Duration; let dur1 = Duration::new(2, 700_000_000); let dur2 = Duration::new(5, 400_000_000); assert_eq!(dur1.div_duration_f32(dur2), 0.5); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#1324)### impl Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#1384)#### pub const fn try\_from\_secs\_f32( secs: f32) -> Result<Duration, FromFloatSecsError> 🔬This is a nightly-only experimental API. (`duration_checked_float` [#83400](https://github.com/rust-lang/rust/issues/83400)) The checked version of [`from_secs_f32`](struct.duration#method.from_secs_f32). This constructor will return an `Err` if `secs` is negative, overflows `Duration` or not finite. ##### Examples ``` #![feature(duration_checked_float)] use std::time::Duration; let res = Duration::try_from_secs_f32(0.0); assert_eq!(res, Ok(Duration::new(0, 0))); let res = Duration::try_from_secs_f32(1e-20); assert_eq!(res, Ok(Duration::new(0, 0))); let res = Duration::try_from_secs_f32(4.2e-7); assert_eq!(res, Ok(Duration::new(0, 420))); let res = Duration::try_from_secs_f32(2.7); assert_eq!(res, Ok(Duration::new(2, 700_000_048))); let res = Duration::try_from_secs_f32(3e10); assert_eq!(res, Ok(Duration::new(30_000_001_024, 0))); // subnormal float: let res = Duration::try_from_secs_f32(f32::from_bits(1)); assert_eq!(res, Ok(Duration::new(0, 0))); let res = Duration::try_from_secs_f32(-5.0); assert!(res.is_err()); let res = Duration::try_from_secs_f32(f32::NAN); assert!(res.is_err()); let res = Duration::try_from_secs_f32(2e19); assert!(res.is_err()); // the conversion uses rounding with tie resolution to even let res = Duration::try_from_secs_f32(0.999e-9); assert_eq!(res, Ok(Duration::new(0, 1))); // this float represents exactly 976562.5e-9 let val = f32::from_bits(0x3A80_0000); let res = Duration::try_from_secs_f32(val); assert_eq!(res, Ok(Duration::new(0, 976_562))); // this float represents exactly 2929687.5e-9 let val = f32::from_bits(0x3B40_0000); let res = Duration::try_from_secs_f32(val); assert_eq!(res, Ok(Duration::new(0, 2_929_688))); // this float represents exactly 1.000_976_562_5 let val = f32::from_bits(0x3F802000); let res = Duration::try_from_secs_f32(val); assert_eq!(res, Ok(Duration::new(1, 976_562))); // this float represents exactly 1.002_929_687_5 let val = f32::from_bits(0x3F806000); let res = Duration::try_from_secs_f32(val); assert_eq!(res, Ok(Duration::new(1, 2_929_688))); ``` [source](https://doc.rust-lang.org/src/core/time.rs.html#1462)#### pub const fn try\_from\_secs\_f64( secs: f64) -> Result<Duration, FromFloatSecsError> 🔬This is a nightly-only experimental API. (`duration_checked_float` [#83400](https://github.com/rust-lang/rust/issues/83400)) The checked version of [`from_secs_f64`](struct.duration#method.from_secs_f64). This constructor will return an `Err` if `secs` is negative, overflows `Duration` or not finite. ##### Examples ``` #![feature(duration_checked_float)] use std::time::Duration; let res = Duration::try_from_secs_f64(0.0); assert_eq!(res, Ok(Duration::new(0, 0))); let res = Duration::try_from_secs_f64(1e-20); assert_eq!(res, Ok(Duration::new(0, 0))); let res = Duration::try_from_secs_f64(4.2e-7); assert_eq!(res, Ok(Duration::new(0, 420))); let res = Duration::try_from_secs_f64(2.7); assert_eq!(res, Ok(Duration::new(2, 700_000_000))); let res = Duration::try_from_secs_f64(3e10); assert_eq!(res, Ok(Duration::new(30_000_000_000, 0))); // subnormal float let res = Duration::try_from_secs_f64(f64::from_bits(1)); assert_eq!(res, Ok(Duration::new(0, 0))); let res = Duration::try_from_secs_f64(-5.0); assert!(res.is_err()); let res = Duration::try_from_secs_f64(f64::NAN); assert!(res.is_err()); let res = Duration::try_from_secs_f64(2e19); assert!(res.is_err()); // the conversion uses rounding with tie resolution to even let res = Duration::try_from_secs_f64(0.999e-9); assert_eq!(res, Ok(Duration::new(0, 1))); let res = Duration::try_from_secs_f64(0.999_999_999_499); assert_eq!(res, Ok(Duration::new(0, 999_999_999))); let res = Duration::try_from_secs_f64(0.999_999_999_501); assert_eq!(res, Ok(Duration::new(1, 0))); let res = Duration::try_from_secs_f64(42.999_999_999_499); assert_eq!(res, Ok(Duration::new(42, 999_999_999))); let res = Duration::try_from_secs_f64(42.999_999_999_501); assert_eq!(res, Ok(Duration::new(43, 0))); // this float represents exactly 976562.5e-9 let val = f64::from_bits(0x3F50_0000_0000_0000); let res = Duration::try_from_secs_f64(val); assert_eq!(res, Ok(Duration::new(0, 976_562))); // this float represents exactly 2929687.5e-9 let val = f64::from_bits(0x3F68_0000_0000_0000); let res = Duration::try_from_secs_f64(val); assert_eq!(res, Ok(Duration::new(0, 2_929_688))); // this float represents exactly 1.000_976_562_5 let val = f64::from_bits(0x3FF0_0400_0000_0000); let res = Duration::try_from_secs_f64(val); assert_eq!(res, Ok(Duration::new(1, 976_562))); // this float represents exactly 1.002_929_687_5 let val = f64::from_bits(0x3_FF00_C000_0000_000); let res = Duration::try_from_secs_f64(val); assert_eq!(res, Ok(Duration::new(1, 2_929_688))); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/time.rs.html#910)### impl Add<Duration> for Duration #### type Output = Duration The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/time.rs.html#913)#### fn add(self, rhs: Duration) -> Duration Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/std/time.rs.html#400-410)1.8.0 · ### impl Add<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#407-409)#### fn add(self, other: Duration) -> Instant ##### Panics This function may panic if the resulting point in time cannot be represented by the underlying data structure. See [`Instant::checked_add`](struct.instant#method.checked_add "Instant::checked_add") for a version without panic. #### type Output = Instant The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#576-586)1.8.0 · ### impl Add<Duration> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#583-585)#### fn add(self, dur: Duration) -> SystemTime ##### Panics This function may panic if the resulting point in time cannot be represented by the underlying data structure. See [`SystemTime::checked_add`](struct.systemtime#method.checked_add "SystemTime::checked_add") for a version without panic. #### type Output = SystemTime The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/core/time.rs.html#919)1.9.0 · ### impl AddAssign<Duration> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#920)#### fn add\_assign(&mut self, rhs: Duration) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#413-417)1.9.0 · ### impl AddAssign<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#414-416)#### fn add\_assign(&mut self, other: Duration) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#589-593)1.9.0 · ### impl AddAssign<Duration> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#590-592)#### fn add\_assign(&mut self, other: Duration) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl Clone for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)#### fn clone(&self) -> Duration Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/time.rs.html#1023)1.27.0 · ### impl Debug for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#1024)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl Default for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)#### fn default() -> Duration Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/time.rs.html#967)### impl Div<u32> for Duration #### type Output = Duration The resulting type after applying the `/` operator. [source](https://doc.rust-lang.org/src/core/time.rs.html#970)#### fn div(self, rhs: u32) -> Duration Performs the `/` operation. [Read more](../ops/trait.div#tymethod.div) [source](https://doc.rust-lang.org/src/core/time.rs.html#976)1.9.0 · ### impl DivAssign<u32> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#977)#### fn div\_assign(&mut self, rhs: u32) Performs the `/=` operation. [Read more](../ops/trait.divassign#tymethod.div_assign) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl Hash for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)#### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/time.rs.html#951)1.31.0 · ### impl Mul<Duration> for u32 #### type Output = Duration The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/time.rs.html#954)#### fn mul(self, rhs: Duration) -> Duration Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/time.rs.html#942)### impl Mul<u32> for Duration #### type Output = Duration The resulting type after applying the `*` operator. [source](https://doc.rust-lang.org/src/core/time.rs.html#945)#### fn mul(self, rhs: u32) -> Duration Performs the `*` operation. [Read more](../ops/trait.mul#tymethod.mul) [source](https://doc.rust-lang.org/src/core/time.rs.html#960)1.9.0 · ### impl MulAssign<u32> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#961)#### fn mul\_assign(&mut self, rhs: u32) Performs the `*=` operation. [Read more](../ops/trait.mulassign#tymethod.mul_assign) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl Ord for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)#### fn cmp(&self, other: &Duration) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl PartialEq<Duration> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)#### fn eq(&self, other: &Duration) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl PartialOrd<Duration> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)#### fn partial\_cmp(&self, other: &Duration) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/time.rs.html#926)### impl Sub<Duration> for Duration #### type Output = Duration The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/core/time.rs.html#929)#### fn sub(self, rhs: Duration) -> Duration Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/std/time.rs.html#420-426)1.8.0 · ### impl Sub<Duration> for Instant #### type Output = Instant The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#423-425)#### fn sub(self, other: Duration) -> Instant Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/std/time.rs.html#596-602)1.8.0 · ### impl Sub<Duration> for SystemTime #### type Output = SystemTime The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#599-601)#### fn sub(self, dur: Duration) -> SystemTime Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/core/time.rs.html#935)1.9.0 · ### impl SubAssign<Duration> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#936)#### fn sub\_assign(&mut self, rhs: Duration) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#429-433)1.9.0 · ### impl SubAssign<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#430-432)#### fn sub\_assign(&mut self, other: Duration) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#605-609)1.9.0 · ### impl SubAssign<Duration> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#606-608)#### fn sub\_assign(&mut self, other: Duration) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/core/time.rs.html#1016)1.16.0 · ### impl<'a> Sum<&'a Duration> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#1017)#### fn sum<I>(iter: I) -> Durationwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [Duration](struct.duration "struct std::time::Duration")>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/time.rs.html#1009)1.16.0 · ### impl Sum<Duration> for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#1010)#### fn sum<I>(iter: I) -> Durationwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Duration](struct.duration "struct std::time::Duration")>, Method which takes an iterator and generates `Self` from the elements by “summing up” the items. [Read more](../iter/trait.sum#tymethod.sum) [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl Copy for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl Eq for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl StructuralEq for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#70)### impl StructuralPartialEq for Duration Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for Duration ### impl Send for Duration ### impl Sync for Duration ### impl Unpin for Duration ### impl UnwindSafe for Duration Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::time::SystemTime Struct std::time::SystemTime ============================ ``` pub struct SystemTime(_); ``` A measurement of the system clock, useful for talking to external entities like the file system or other processes. Distinct from the [`Instant`](struct.instant "Instant") type, this time measurement **is not monotonic**. This means that you can save a file to the file system, then save another file to the file system, **and the second file has a `SystemTime` measurement earlier than the first**. In other words, an operation that happens after another operation in real time may have an earlier `SystemTime`! Consequently, comparing two `SystemTime` instances to learn about the duration between them returns a [`Result`](../result/enum.result "Result") instead of an infallible [`Duration`](struct.duration "Duration") to indicate that this sort of time drift may happen and needs to be handled. Although a `SystemTime` cannot be directly inspected, the [`UNIX_EPOCH`](constant.unix_epoch "UNIX_EPOCH") constant is provided in this module as an anchor in time to learn information about a `SystemTime`. By calculating the duration from this fixed point in time, a `SystemTime` can be converted to a human-readable time, or perhaps some other string representation. The size of a `SystemTime` struct may vary depending on the target operating system. Example: ``` use std::time::{Duration, SystemTime}; use std::thread::sleep; fn main() { let now = SystemTime::now(); // we sleep for 2 seconds sleep(Duration::new(2, 0)); match now.elapsed() { Ok(elapsed) => { // it prints '2' println!("{}", elapsed.as_secs()); } Err(e) => { // an error occurred! println!("Error: {e:?}"); } } } ``` Platform-specific behavior -------------------------- The precision of `SystemTime` can depend on the underlying OS-specific time format. For example, on Windows the time is represented in 100 nanosecond intervals whereas Linux can represent nanosecond intervals. The following system calls are [currently](../io/index#platform-specific-behavior) being used by `now()` to find out the current time: | Platform | System call | | --- | --- | | SGX | [`insecure_time` usercall](https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time). More information on [timekeeping in SGX](https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode) | | UNIX | [clock\_gettime (Realtime Clock)](https://linux.die.net/man/3/clock_gettime) | | Darwin | [gettimeofday](https://man7.org/linux/man-pages/man2/gettimeofday.2.html) | | VXWorks | [clock\_gettime (Realtime Clock)](https://linux.die.net/man/3/clock_gettime) | | SOLID | `SOLID_RTC_ReadTime` | | WASI | [\_\_wasi\_clock\_time\_get (Realtime Clock)](https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md#clock_time_get) | | Windows | [GetSystemTimePreciseAsFileTime](https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime) / [GetSystemTimeAsFileTime](https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime) | **Disclaimer:** These system calls might change over time. > Note: mathematical operations like [`add`](struct.systemtime#method.add) may panic if the underlying structure cannot represent the new point in time. > > Implementations --------------- [source](https://doc.rust-lang.org/src/std/time.rs.html#461-573)### impl SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#482)1.28.0 · #### pub const UNIX\_EPOCH: SystemTime = UNIX\_EPOCH An anchor in time which can be used to create new `SystemTime` instances or learn about where in time a `SystemTime` lies. This constant is defined to be “1970-01-01 00:00:00 UTC” on all systems with respect to the system clock. Using `duration_since` on an existing `SystemTime` instance can tell how far away from this point in time a measurement lies, and using `UNIX_EPOCH + duration` can be used to create a `SystemTime` instance to represent another fixed point in time. ##### Examples ``` use std::time::SystemTime; match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()), Err(_) => panic!("SystemTime before UNIX EPOCH!"), } ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#495-497)#### pub fn now() -> SystemTime Returns the system time corresponding to “now”. ##### Examples ``` use std::time::SystemTime; let sys_time = SystemTime::now(); ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#524-526)#### pub fn duration\_since( &self, earlier: SystemTime) -> Result<Duration, SystemTimeError> Returns the amount of time elapsed from an earlier point in time. This function may fail because measurements taken earlier are not guaranteed to always be before later measurements (due to anomalies such as the system clock being adjusted either forwards or backwards). [`Instant`](struct.instant "Instant") can be used to measure elapsed time without this risk of failure. If successful, `[Ok](../result/enum.result#variant.Ok "Ok")([Duration](struct.duration "Duration"))` is returned where the duration represents the amount of time elapsed from the specified measurement to this one. Returns an [`Err`](../result/enum.result#variant.Err "Err") if `earlier` is later than `self`, and the error contains how far from `self` the time is. ##### Examples ``` use std::time::SystemTime; let sys_time = SystemTime::now(); let new_sys_time = SystemTime::now(); let difference = new_sys_time.duration_since(sys_time) .expect("Clock may have gone backwards"); println!("{difference:?}"); ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#554-556)#### pub fn elapsed(&self) -> Result<Duration, SystemTimeError> Returns the difference between the clock time when this system time was created, and the current clock time. This function may fail as the underlying system clock is susceptible to drift and updates (e.g., the system clock could go backwards), so this function might not always succeed. If successful, `[Ok](../result/enum.result#variant.Ok "Ok")([Duration](struct.duration "Duration"))` is returned where the duration represents the amount of time elapsed from this time measurement to the current time. To measure elapsed time reliably, use [`Instant`](struct.instant "Instant") instead. Returns an [`Err`](../result/enum.result#variant.Err "Err") if `self` is later than the current system time, and the error contains how far from the current system time `self` is. ##### Examples ``` use std::thread::sleep; use std::time::{Duration, SystemTime}; let sys_time = SystemTime::now(); let one_sec = Duration::from_secs(1); sleep(one_sec); assert!(sys_time.elapsed().unwrap() >= one_sec); ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#562-564)1.34.0 · #### pub fn checked\_add(&self, duration: Duration) -> Option<SystemTime> Returns `Some(t)` where `t` is the time `self + duration` if `t` can be represented as `SystemTime` (which means it’s inside the bounds of the underlying data structure), `None` otherwise. [source](https://doc.rust-lang.org/src/std/time.rs.html#570-572)1.34.0 · #### pub fn checked\_sub(&self, duration: Duration) -> Option<SystemTime> Returns `Some(t)` where `t` is the time `self - duration` if `t` can be represented as `SystemTime` (which means it’s inside the bounds of the underlying data structure), `None` otherwise. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/time.rs.html#576-586)### impl Add<Duration> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#583-585)#### fn add(self, dur: Duration) -> SystemTime ##### Panics This function may panic if the resulting point in time cannot be represented by the underlying data structure. See [`SystemTime::checked_add`](struct.systemtime#method.checked_add "SystemTime::checked_add") for a version without panic. #### type Output = SystemTime The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#589-593)1.9.0 · ### impl AddAssign<Duration> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#590-592)#### fn add\_assign(&mut self, other: Duration) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl Clone for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)#### fn clone(&self) -> SystemTime Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/time.rs.html#612-616)### impl Debug for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#613-615)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl Hash for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)#### fn hash<\_\_H: Hasher>(&self, state: &mut \_\_H) Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl Ord for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)#### fn cmp(&self, other: &SystemTime) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl PartialEq<SystemTime> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)#### fn eq(&self, other: &SystemTime) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl PartialOrd<SystemTime> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)#### fn partial\_cmp(&self, other: &SystemTime) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/time.rs.html#596-602)### impl Sub<Duration> for SystemTime #### type Output = SystemTime The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#599-601)#### fn sub(self, dur: Duration) -> SystemTime Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/std/time.rs.html#605-609)1.9.0 · ### impl SubAssign<Duration> for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#606-608)#### fn sub\_assign(&mut self, other: Duration) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl Copy for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl Eq for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl StructuralEq for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#237)### impl StructuralPartialEq for SystemTime Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for SystemTime ### impl Send for SystemTime ### impl Sync for SystemTime ### impl Unpin for SystemTime ### impl UnwindSafe for SystemTime Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::time::Instant Struct std::time::Instant ========================= ``` pub struct Instant(_); ``` A measurement of a monotonically nondecreasing clock. Opaque and useful only with [`Duration`](struct.duration "Duration"). Instants are always guaranteed, barring [platform bugs](struct.instant#monotonicity), to be no less than any previously measured instant when created, and are often useful for tasks such as measuring benchmarks or timing how long an operation takes. Note, however, that instants are **not** guaranteed to be **steady**. In other words, each tick of the underlying clock might not be the same length (e.g. some seconds may be longer than others). An instant may jump forwards or experience time dilation (slow down or speed up), but it will never go backwards. Instants are opaque types that can only be compared to one another. There is no method to get “the number of seconds” from an instant. Instead, it only allows measuring the duration between two instants (or comparing two instants). The size of an `Instant` struct may vary depending on the target operating system. Example: ``` use std::time::{Duration, Instant}; use std::thread::sleep; fn main() { let now = Instant::now(); // we sleep for 2 seconds sleep(Duration::new(2, 0)); // it prints '2' println!("{}", now.elapsed().as_secs()); } ``` OS-specific behaviors --------------------- An `Instant` is a wrapper around system-specific types and it may behave differently depending on the underlying operating system. For example, the following snippet is fine on Linux but panics on macOS: ``` use std::time::{Instant, Duration}; let now = Instant::now(); let max_seconds = u64::MAX / 1_000_000_000; let duration = Duration::new(max_seconds, 0); println!("{:?}", now + duration); ``` Underlying System calls ----------------------- The following system calls are [currently](../io/index#platform-specific-behavior) being used by `now()` to find out the current time: | Platform | System call | | --- | --- | | SGX | [`insecure_time` usercall](https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time). More information on [timekeeping in SGX](https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode) | | UNIX | [clock\_gettime (Monotonic Clock)](https://linux.die.net/man/3/clock_gettime) | | Darwin | [mach\_absolute\_time](https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/services/services.html) | | VXWorks | [clock\_gettime (Monotonic Clock)](https://linux.die.net/man/3/clock_gettime) | | SOLID | `get_tim` | | WASI | [\_\_wasi\_clock\_time\_get (Monotonic Clock)](https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md#clock_time_get) | | Windows | [QueryPerformanceCounter](https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter) | **Disclaimer:** These system calls might change over time. > Note: mathematical operations like [`add`](struct.instant#method.add) may panic if the underlying structure cannot represent the new point in time. > > ### Monotonicity On all platforms `Instant` will try to use an OS API that guarantees monotonic behavior if available, which is the case for all [tier 1](https://doc.rust-lang.org/rustc/platform-support.html) platforms. In practice such guarantees are – under rare circumstances – broken by hardware, virtualization or operating system bugs. To work around these bugs and platforms not offering monotonic clocks [`duration_since`](struct.instant#method.duration_since), [`elapsed`](struct.instant#method.elapsed) and [`sub`](struct.instant#method.sub) saturate to zero. In older Rust versions this lead to a panic instead. [`checked_duration_since`](struct.instant#method.checked_duration_since) can be used to detect and handle situations where monotonicity is violated, or `Instant`s are subtracted in the wrong order. This workaround obscures programming errors where earlier and later instants are accidentally swapped. For this reason future rust versions may reintroduce panics. Implementations --------------- [source](https://doc.rust-lang.org/src/std/time.rs.html#263-397)### impl Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#275-277)#### pub fn now() -> Instant Returns an instant corresponding to “now”. ##### Examples ``` use std::time::Instant; let now = Instant::now(); ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#304-306)#### pub fn duration\_since(&self, earlier: Instant) -> Duration Returns the amount of time elapsed from another instant to this one, or zero duration if that instant is later than this one. ##### Panics Previous rust versions panicked when `earlier` was later than `self`. Currently this method saturates. Future versions may reintroduce the panic in some circumstances. See [Monotonicity](struct.instant#monotonicity). ##### Examples ``` use std::time::{Duration, Instant}; use std::thread::sleep; let now = Instant::now(); sleep(Duration::new(1, 0)); let new_now = Instant::now(); println!("{:?}", new_now.duration_since(now)); println!("{:?}", now.duration_since(new_now)); // 0ns ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#330-332)1.39.0 · #### pub fn checked\_duration\_since(&self, earlier: Instant) -> Option<Duration> Returns the amount of time elapsed from another instant to this one, or None if that instant is later than this one. Due to [monotonicity bugs](struct.instant#monotonicity), even under correct logical ordering of the passed `Instant`s, this method can return `None`. ##### Examples ``` use std::time::{Duration, Instant}; use std::thread::sleep; let now = Instant::now(); sleep(Duration::new(1, 0)); let new_now = Instant::now(); println!("{:?}", new_now.checked_duration_since(now)); println!("{:?}", now.checked_duration_since(new_now)); // None ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#351-353)1.39.0 · #### pub fn saturating\_duration\_since(&self, earlier: Instant) -> Duration Returns the amount of time elapsed from another instant to this one, or zero duration if that instant is later than this one. ##### Examples ``` use std::time::{Duration, Instant}; use std::thread::sleep; let now = Instant::now(); sleep(Duration::new(1, 0)); let new_now = Instant::now(); println!("{:?}", new_now.saturating_duration_since(now)); println!("{:?}", now.saturating_duration_since(new_now)); // 0ns ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#378-380)#### pub fn elapsed(&self) -> Duration Returns the amount of time elapsed since this instant was created. ##### Panics Previous rust versions panicked when self was earlier than the current time. Currently this method returns a Duration of zero in that case. Future versions may reintroduce the panic. See [Monotonicity](struct.instant#monotonicity). ##### Examples ``` use std::thread::sleep; use std::time::{Duration, Instant}; let instant = Instant::now(); let three_secs = Duration::from_secs(3); sleep(three_secs); assert!(instant.elapsed() >= three_secs); ``` [source](https://doc.rust-lang.org/src/std/time.rs.html#386-388)1.34.0 · #### pub fn checked\_add(&self, duration: Duration) -> Option<Instant> Returns `Some(t)` where `t` is the time `self + duration` if `t` can be represented as `Instant` (which means it’s inside the bounds of the underlying data structure), `None` otherwise. [source](https://doc.rust-lang.org/src/std/time.rs.html#394-396)1.34.0 · #### pub fn checked\_sub(&self, duration: Duration) -> Option<Instant> Returns `Some(t)` where `t` is the time `self - duration` if `t` can be represented as `Instant` (which means it’s inside the bounds of the underlying data structure), `None` otherwise. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/time.rs.html#400-410)### impl Add<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#407-409)#### fn add(self, other: Duration) -> Instant ##### Panics This function may panic if the resulting point in time cannot be represented by the underlying data structure. See [`Instant::checked_add`](struct.instant#method.checked_add "Instant::checked_add") for a version without panic. #### type Output = Instant The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#413-417)1.9.0 · ### impl AddAssign<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#414-416)#### fn add\_assign(&mut self, other: Duration) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl Clone for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)#### fn clone(&self) -> Instant Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/time.rs.html#455-459)### impl Debug for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#456-458)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl Hash for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)#### fn hash<\_\_H: Hasher>(&self, state: &mut \_\_H) Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl Ord for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)#### fn cmp(&self, other: &Instant) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl PartialEq<Instant> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)#### fn eq(&self, other: &Instant) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl PartialOrd<Instant> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)#### fn partial\_cmp(&self, other: &Instant) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/time.rs.html#420-426)### impl Sub<Duration> for Instant #### type Output = Instant The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#423-425)#### fn sub(self, other: Duration) -> Instant Performs the `-` operation. [Read more](../ops/trait.sub#tymethod.sub) [source](https://doc.rust-lang.org/src/std/time.rs.html#436-452)### impl Sub<Instant> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#449-451)#### fn sub(self, other: Instant) -> Duration Returns the amount of time elapsed from another instant to this one, or zero duration if that instant is later than this one. ##### Panics Previous rust versions panicked when `other` was later than `self`. Currently this method saturates. Future versions may reintroduce the panic in some circumstances. See [Monotonicity](struct.instant#monotonicity). #### type Output = Duration The resulting type after applying the `-` operator. [source](https://doc.rust-lang.org/src/std/time.rs.html#429-433)1.9.0 · ### impl SubAssign<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#430-432)#### fn sub\_assign(&mut self, other: Duration) Performs the `-=` operation. [Read more](../ops/trait.subassign#tymethod.sub_assign) [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl Copy for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl Eq for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl StructuralEq for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#152)### impl StructuralPartialEq for Instant Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for Instant ### impl Send for Instant ### impl Sync for Instant ### impl Unpin for Instant ### impl UnwindSafe for Instant Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::u32 Module std::u32 =============== 👎Deprecating in a future Rust version: all constants in this module replaced by associated constants on `u32` Constants for the 32-bit unsigned integer type. *[See also the `u32` primitive type](../primitive.u32 "u32").* New code should use the associated constants directly on the primitive type. Constants --------- [MAX](constant.max "std::u32::MAX constant")Deprecation planned The largest value that can be represented by this integer type. Use [`u32::MAX`](../primitive.u32#associatedconstant.MAX "u32::MAX") instead. [MIN](constant.min "std::u32::MIN constant")Deprecation planned The smallest value that can be represented by this integer type. Use [`u32::MIN`](../primitive.u32#associatedconstant.MIN "u32::MIN") instead. rust Constant std::u32::MAX Constant std::u32::MAX ====================== ``` pub const MAX: u32 = u32::MAX; // 4_294_967_295u32 ``` 👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type The largest value that can be represented by this integer type. Use [`u32::MAX`](../primitive.u32#associatedconstant.MAX "u32::MAX") instead. Examples -------- ``` // deprecated way let max = std::u32::MAX; // intended way let max = u32::MAX; ``` rust Constant std::u32::MIN Constant std::u32::MIN ====================== ``` pub const MIN: u32 = u32::MIN; // 0u32 ``` 👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type The smallest value that can be represented by this integer type. Use [`u32::MIN`](../primitive.u32#associatedconstant.MIN "u32::MIN") instead. Examples -------- ``` // deprecated way let min = std::u32::MIN; // intended way let min = u32::MIN; ``` rust Function std::env::var Function std::env::var ====================== ``` pub fn var<K: AsRef<OsStr>>(key: K) -> Result<String, VarError> ``` Fetches the environment variable `key` from the current process. Errors ------ This function will return an error if the environment variable isn’t set. This function may return an error if the environment variable’s name contains the equal sign character (`=`) or the NUL character. This function will return an error if the environment variable’s value is not valid Unicode. If this is not desired, consider using [`var_os`](fn.var_os "var_os"). Examples -------- ``` use std::env; let key = "HOME"; match env::var(key) { Ok(val) => println!("{key}: {val:?}"), Err(e) => println!("couldn't interpret {key}: {e}"), } ``` rust Module std::env Module std::env =============== Inspection and manipulation of the process’s environment. This module contains functions to inspect various aspects such as environment variables, process arguments, the current directory, and various other important directories. There are several functions and structs in this module that have a counterpart ending in `os`. Those ending in `os` will return an [`OsString`](../ffi/struct.osstring "OsString") and those without will return a [`String`](../string/struct.string "String"). Modules ------- [consts](consts/index "std::env::consts mod") Constants associated with the current target Structs ------- [Args](struct.args "std::env::Args struct") An iterator over the arguments of a process, yielding a [`String`](../string/struct.string "String") value for each argument. [ArgsOs](struct.argsos "std::env::ArgsOs struct") An iterator over the arguments of a process, yielding an [`OsString`](../ffi/struct.osstring "OsString") value for each argument. [JoinPathsError](struct.joinpathserror "std::env::JoinPathsError struct") The error type for operations on the `PATH` variable. Possibly returned from [`env::join_paths()`](fn.join_paths). [SplitPaths](struct.splitpaths "std::env::SplitPaths struct") An iterator that splits an environment variable into paths according to platform-specific conventions. [Vars](struct.vars "std::env::Vars struct") An iterator over a snapshot of the environment variables of this process. [VarsOs](struct.varsos "std::env::VarsOs struct") An iterator over a snapshot of the environment variables of this process. Enums ----- [VarError](enum.varerror "std::env::VarError enum") The error type for operations interacting with environment variables. Possibly returned from [`env::var()`](fn.var). Functions --------- [args](fn.args "std::env::args fn") Returns the arguments that this program was started with (normally passed via the command line). [args\_os](fn.args_os "std::env::args_os fn") Returns the arguments that this program was started with (normally passed via the command line). [current\_dir](fn.current_dir "std::env::current_dir fn") Returns the current working directory as a [`PathBuf`](../path/struct.pathbuf "PathBuf"). [current\_exe](fn.current_exe "std::env::current_exe fn") Returns the full filesystem path of the current running executable. [home\_dir](fn.home_dir "std::env::home_dir fn")Deprecated Returns the path of the current user’s home directory if known. [join\_paths](fn.join_paths "std::env::join_paths fn") Joins a collection of [`Path`](../path/struct.path "Path")s appropriately for the `PATH` environment variable. [remove\_var](fn.remove_var "std::env::remove_var fn") Removes an environment variable from the environment of the currently running process. [set\_current\_dir](fn.set_current_dir "std::env::set_current_dir fn") Changes the current working directory to the specified path. [set\_var](fn.set_var "std::env::set_var fn") Sets the environment variable `key` to the value `value` for the currently running process. [split\_paths](fn.split_paths "std::env::split_paths fn") Parses input according to platform conventions for the `PATH` environment variable. [temp\_dir](fn.temp_dir "std::env::temp_dir fn") Returns the path of a temporary directory. [var](fn.var "std::env::var fn") Fetches the environment variable `key` from the current process. [var\_os](fn.var_os "std::env::var_os fn") Fetches the environment variable `key` from the current process, returning [`None`](../option/enum.option#variant.None "None") if the variable isn’t set or there’s another error. [vars](fn.vars "std::env::vars fn") Returns an iterator of (variable, value) pairs of strings, for all the environment variables of the current process. [vars\_os](fn.vars_os "std::env::vars_os fn") Returns an iterator of (variable, value) pairs of OS strings, for all the environment variables of the current process. rust Function std::env::join_paths Function std::env::join\_paths ============================== ``` pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError>where    I: IntoIterator<Item = T>,    T: AsRef<OsStr>, ``` Joins a collection of [`Path`](../path/struct.path "Path")s appropriately for the `PATH` environment variable. Errors ------ Returns an [`Err`](../result/enum.result#variant.Err "Err") (containing an error message) if one of the input [`Path`](../path/struct.path "Path")s contains an invalid character for constructing the `PATH` variable (a double quote on Windows or a colon on Unix). Examples -------- Joining paths on a Unix-like platform: ``` use std::env; use std::ffi::OsString; use std::path::Path; fn main() -> Result<(), env::JoinPathsError> { let paths = [Path::new("/bin"), Path::new("/usr/bin")]; let path_os_string = env::join_paths(paths.iter())?; assert_eq!(path_os_string, OsString::from("/bin:/usr/bin")); Ok(()) } ``` Joining a path containing a colon on a Unix-like platform results in an error: ``` use std::env; use std::path::Path; let paths = [Path::new("/bin"), Path::new("/usr/bi:n")]; assert!(env::join_paths(paths.iter()).is_err()); ``` Using `env::join_paths()` with [`env::split_paths()`](fn.split_paths) to append an item to the `PATH` environment variable: ``` use std::env; use std::path::PathBuf; fn main() -> Result<(), env::JoinPathsError> { if let Some(path) = env::var_os("PATH") { let mut paths = env::split_paths(&path).collect::<Vec<_>>(); paths.push(PathBuf::from("/home/xyz/bin")); let new_path = env::join_paths(paths)?; env::set_var("PATH", &new_path); } Ok(()) } ``` rust Struct std::env::ArgsOs Struct std::env::ArgsOs ======================= ``` pub struct ArgsOs { /* private fields */ } ``` An iterator over the arguments of a process, yielding an [`OsString`](../ffi/struct.osstring "OsString") value for each argument. This struct is created by [`env::args_os()`](fn.args_os). See its documentation for more. The first element is traditionally the path of the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not be relied upon for security purposes. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#871-875)1.16.0 · ### impl Debug for ArgsOs [source](https://doc.rust-lang.org/src/std/env.rs.html#872-874)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#864-868)1.12.0 · ### impl DoubleEndedIterator for ArgsOs [source](https://doc.rust-lang.org/src/std/env.rs.html#865-867)#### fn next\_back(&mut self) -> Option<OsString> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/std/env.rs.html#854-861)### impl ExactSizeIterator for ArgsOs [source](https://doc.rust-lang.org/src/std/env.rs.html#855-857)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/std/env.rs.html#858-860)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/std/env.rs.html#843-851)### impl Iterator for ArgsOs #### type Item = OsString The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/env.rs.html#845-847)#### fn next(&mut self) -> Option<OsString> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/std/env.rs.html#848-850)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)#### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/std/env.rs.html#837)1.26.0 · ### impl !Send for ArgsOs [source](https://doc.rust-lang.org/src/std/env.rs.html#840)1.26.0 · ### impl !Sync for ArgsOs Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for ArgsOs ### impl Unpin for ArgsOs ### impl UnwindSafe for ArgsOs Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::env::var_os Function std::env::var\_os ========================== ``` pub fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString> ``` Fetches the environment variable `key` from the current process, returning [`None`](../option/enum.option#variant.None "None") if the variable isn’t set or there’s another error. Note that the method will not check if the environment variable is valid Unicode. If you want to have an error on invalid UTF-8, use the [`var`](fn.var "var") function instead. Errors ------ This function returns an error if the environment variable isn’t set. This function may return an error if the environment variable’s name contains the equal sign character (`=`) or the NUL character. This function may return an error if the environment variable’s value contains the NUL character. Examples -------- ``` use std::env; let key = "HOME"; match env::var_os(key) { Some(val) => println!("{key}: {val:?}"), None => println!("{key} is not defined in the environment.") } ``` rust Function std::env::vars_os Function std::env::vars\_os =========================== ``` pub fn vars_os() -> VarsOsⓘNotable traits for VarsOsimpl Iterator for VarsOs type Item = (OsString, OsString); ``` Returns an iterator of (variable, value) pairs of OS strings, for all the environment variables of the current process. The returned iterator contains a snapshot of the process’s environment variables at the time of this invocation. Modifications to environment variables afterwards will not be reflected in the returned iterator. Note that the returned iterator will not check if the environment variables are valid Unicode. If you want to panic on invalid UTF-8, use the [`vars`](fn.vars "vars") function instead. Examples -------- ``` use std::env; // We will iterate through the references to the element returned by // env::vars_os(); for (key, value) in env::vars_os() { println!("{key:?}: {value:?}"); } ``` rust Function std::env::set_current_dir Function std::env::set\_current\_dir ==================================== ``` pub fn set_current_dir<P: AsRef<Path>>(path: P) -> Result<()> ``` Changes the current working directory to the specified path. Platform-specific behavior -------------------------- This function [currently](../io/index#platform-specific-behavior) corresponds to the `chdir` function on Unix and the `SetCurrentDirectoryW` function on Windows. Returns an [`Err`](../result/enum.result#variant.Err "Err") if the operation fails. Examples -------- ``` use std::env; use std::path::Path; let root = Path::new("/"); assert!(env::set_current_dir(&root).is_ok()); println!("Successfully changed working directory to {}!", root.display()); ``` rust Function std::env::split_paths Function std::env::split\_paths =============================== ``` pub fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths<'_>ⓘNotable traits for SplitPaths<'a>impl<'a> Iterator for SplitPaths<'a> type Item = PathBuf; ``` Parses input according to platform conventions for the `PATH` environment variable. Returns an iterator over the paths contained in `unparsed`. The iterator element type is [`PathBuf`](../path/struct.pathbuf "PathBuf"). Examples -------- ``` use std::env; let key = "PATH"; match env::var_os(key) { Some(paths) => { for path in env::split_paths(&paths) { println!("'{}'", path.display()); } } None => println!("{key} is not defined in the environment.") } ``` rust Function std::env::current_exe Function std::env::current\_exe =============================== ``` pub fn current_exe() -> Result<PathBuf> ``` Returns the full filesystem path of the current running executable. Platform-specific behavior -------------------------- If the executable was invoked through a symbolic link, some platforms will return the path of the symbolic link and other platforms will return the path of the symbolic link’s target. If the executable is renamed while it is running, platforms may return the path at the time it was loaded instead of the new path. Errors ------ Acquiring the path of the current executable is a platform-specific operation that can fail for a good number of reasons. Some errors can include, but not be limited to, filesystem operations failing or general syscall failures. Security -------- The output of this function should not be trusted for anything that might have security implications. Basically, if users can run the executable, they can change the output arbitrarily. As an example, you can easily introduce a race condition. It goes like this: 1. You get the path to the current executable using `current_exe()`, and store it in a variable. 2. Time passes. A malicious actor removes the current executable, and replaces it with a malicious one. 3. You then use the stored path to re-execute the current executable. You expected to safely execute the current executable, but you’re instead executing something completely different. The code you just executed run with your privileges. This sort of behavior has been known to [lead to privilege escalation](https://securityvulns.com/Wdocument183.html) when used incorrectly. Examples -------- ``` use std::env; match env::current_exe() { Ok(exe_path) => println!("Path of this executable is: {}", exe_path.display()), Err(e) => println!("failed to get current exe path: {e}"), }; ``` rust Struct std::env::JoinPathsError Struct std::env::JoinPathsError =============================== ``` pub struct JoinPathsError { /* private fields */ } ``` The error type for operations on the `PATH` variable. Possibly returned from [`env::join_paths()`](fn.join_paths). Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#461)### impl Debug for JoinPathsError [source](https://doc.rust-lang.org/src/std/env.rs.html#461)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#538-542)### impl Display for JoinPathsError [source](https://doc.rust-lang.org/src/std/env.rs.html#539-541)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#545-550)### impl Error for JoinPathsError [source](https://doc.rust-lang.org/src/std/env.rs.html#547-549)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)#### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for JoinPathsError ### impl Send for JoinPathsError ### impl Sync for JoinPathsError ### impl Unpin for JoinPathsError ### impl UnwindSafe for JoinPathsError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Function std::env::remove_var Function std::env::remove\_var ============================== ``` pub fn remove_var<K: AsRef<OsStr>>(key: K) ``` Removes an environment variable from the environment of the currently running process. Note that while concurrent access to environment variables is safe in Rust, some platforms only expose inherently unsafe non-threadsafe APIs for inspecting the environment. As a result extra care needs to be taken when auditing calls to unsafe external FFI functions to ensure that any external environment accesses are properly synchronized with accesses in Rust. Discussion of this unsafety on Unix may be found in: * [Austin Group Bugzilla](https://austingroupbugs.net/view.php?id=188) * [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2) Panics ------ This function may panic if `key` is empty, contains an ASCII equals sign `'='` or the NUL character `'\0'`, or when the value contains the NUL character. Examples -------- ``` use std::env; let key = "KEY"; env::set_var(key, "VALUE"); assert_eq!(env::var(key), Ok("VALUE".to_string())); env::remove_var(key); assert!(env::var(key).is_err()); ``` rust Function std::env::temp_dir Function std::env::temp\_dir ============================ ``` pub fn temp_dir() -> PathBuf ``` Returns the path of a temporary directory. The temporary directory may be shared among users, or between processes with different privileges; thus, the creation of any files or directories in the temporary directory must use a secure method to create a uniquely named file. Creating a file or directory with a fixed or predictable name may result in “insecure temporary file” security vulnerabilities. Consider using a crate that securely creates temporary files or directories. Platform-specific behavior -------------------------- On Unix, returns the value of the `TMPDIR` environment variable if it is set, otherwise for non-Android it returns `/tmp`. If Android, since there is no global temporary folder (it is usually allocated per-app), it returns `/data/local/tmp`. On Windows, the behavior is equivalent to that of [`GetTempPath2`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppath2a) / [`GetTempPath`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppatha), which this function uses internally. Note that, this [may change in the future](../io/index#platform-specific-behavior). ``` use std::env; fn main() { let dir = env::temp_dir(); println!("Temporary directory: {}", dir.display()); } ``` rust Function std::env::home_dir Function std::env::home\_dir ============================ ``` pub fn home_dir() -> Option<PathBuf> ``` 👎Deprecated since 1.29.0: This function’s behavior is unexpected and probably not what you want. Consider using a crate from crates.io instead. Returns the path of the current user’s home directory if known. Unix ---- * Returns the value of the ‘HOME’ environment variable if it is set (including to an empty string). * Otherwise, it tries to determine the home directory by invoking the `getpwuid_r` function using the UID of the current user. An empty home directory field returned from the `getpwuid_r` function is considered to be a valid value. * Returns `None` if the current user has no entry in the /etc/passwd file. Windows ------- * Returns the value of the ‘HOME’ environment variable if it is set (including to an empty string). * Otherwise, returns the value of the ‘USERPROFILE’ environment variable if it is set (including to an empty string). * If both do not exist, [`GetUserProfileDirectory`](https://docs.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectorya) is used to return the path. Examples -------- ``` use std::env; match env::home_dir() { Some(path) => println!("Your home directory, probably: {}", path.display()), None => println!("Impossible to get your home dir!"), } ``` rust Struct std::env::Args Struct std::env::Args ===================== ``` pub struct Args { /* private fields */ } ``` An iterator over the arguments of a process, yielding a [`String`](../string/struct.string "String") value for each argument. This struct is created by [`env::args()`](fn.args). See its documentation for more. The first element is traditionally the path of the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not be relied upon for security purposes. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#830-834)1.16.0 · ### impl Debug for Args [source](https://doc.rust-lang.org/src/std/env.rs.html#831-833)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#823-827)1.12.0 · ### impl DoubleEndedIterator for Args [source](https://doc.rust-lang.org/src/std/env.rs.html#824-826)#### fn next\_back(&mut self) -> Option<String> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/std/env.rs.html#813-820)### impl ExactSizeIterator for Args [source](https://doc.rust-lang.org/src/std/env.rs.html#814-816)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/std/env.rs.html#817-819)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/std/env.rs.html#802-810)### impl Iterator for Args #### type Item = String The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/env.rs.html#804-806)#### fn next(&mut self) -> Option<String> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/std/env.rs.html#807-809)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)#### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/std/env.rs.html#796)1.26.0 · ### impl !Send for Args [source](https://doc.rust-lang.org/src/std/env.rs.html#799)1.26.0 · ### impl !Sync for Args Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for Args ### impl Unpin for Args ### impl UnwindSafe for Args Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::env::vars Function std::env::vars ======================= ``` pub fn vars() -> VarsⓘNotable traits for Varsimpl Iterator for Vars type Item = (String, String); ``` Returns an iterator of (variable, value) pairs of strings, for all the environment variables of the current process. The returned iterator contains a snapshot of the process’s environment variables at the time of this invocation. Modifications to environment variables afterwards will not be reflected in the returned iterator. Panics ------ While iterating, the returned iterator will panic if any key or value in the environment is not valid unicode. If this is not desired, consider using [`env::vars_os()`](fn.vars_os). Examples -------- ``` use std::env; // We will iterate through the references to the element returned by // env::vars(); for (key, value) in env::vars() { println!("{key}: {value}"); } ``` rust Struct std::env::SplitPaths Struct std::env::SplitPaths =========================== ``` pub struct SplitPaths<'a> { /* private fields */ } ``` An iterator that splits an environment variable into paths according to platform-specific conventions. The iterator element type is [`PathBuf`](../path/struct.pathbuf "PathBuf"). This structure is created by [`env::split_paths()`](fn.split_paths). See its documentation for more. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#451-455)1.16.0 · ### impl Debug for SplitPaths<'\_> [source](https://doc.rust-lang.org/src/std/env.rs.html#452-454)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#440-448)### impl<'a> Iterator for SplitPaths<'a> #### type Item = PathBuf The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/env.rs.html#442-444)#### fn next(&mut self) -> Option<PathBuf> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/std/env.rs.html#445-447)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl<'a> RefUnwindSafe for SplitPaths<'a> ### impl<'a> Send for SplitPaths<'a> ### impl<'a> Sync for SplitPaths<'a> ### impl<'a> Unpin for SplitPaths<'a> ### impl<'a> UnwindSafe for SplitPaths<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::env::args_os Function std::env::args\_os =========================== ``` pub fn args_os() -> ArgsOsⓘNotable traits for ArgsOsimpl Iterator for ArgsOs type Item = OsString; ``` Returns the arguments that this program was started with (normally passed via the command line). The first element is traditionally the path of the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not be relied upon for security purposes. On Unix systems the shell usually expands unquoted arguments with glob patterns (such as `*` and `?`). On Windows this is not done, and such arguments are passed as-is. On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`. glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard extension. This allows `std::env::args_os` to work even in a `cdylib` or `staticlib`, as it does on macOS and Windows. Note that the returned iterator will not check if the arguments to the process are valid Unicode. If you want to panic on invalid UTF-8, use the [`args`](fn.args "args") function instead. Examples -------- ``` use std::env; // Prints each argument on a separate line for argument in env::args_os() { println!("{argument:?}"); } ``` rust Function std::env::set_var Function std::env::set\_var =========================== ``` pub fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) ``` Sets the environment variable `key` to the value `value` for the currently running process. Note that while concurrent access to environment variables is safe in Rust, some platforms only expose inherently unsafe non-threadsafe APIs for inspecting the environment. As a result, extra care needs to be taken when auditing calls to unsafe external FFI functions to ensure that any external environment accesses are properly synchronized with accesses in Rust. Discussion of this unsafety on Unix may be found in: * [Austin Group Bugzilla](https://austingroupbugs.net/view.php?id=188) * [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2) Panics ------ This function may panic if `key` is empty, contains an ASCII equals sign `'='` or the NUL character `'\0'`, or when `value` contains the NUL character. Examples -------- ``` use std::env; let key = "KEY"; env::set_var(key, "VALUE"); assert_eq!(env::var(key), Ok("VALUE".to_string())); ``` rust Function std::env::current_dir Function std::env::current\_dir =============================== ``` pub fn current_dir() -> Result<PathBuf> ``` Returns the current working directory as a [`PathBuf`](../path/struct.pathbuf "PathBuf"). Platform-specific behavior -------------------------- This function [currently](../io/index#platform-specific-behavior) corresponds to the `getcwd` function on Unix and the `GetCurrentDirectoryW` function on Windows. Errors ------ Returns an [`Err`](../result/enum.result#variant.Err "Err") if the current working directory value is invalid. Possible cases: * Current directory does not exist. * There are insufficient permissions to access the current directory. Examples -------- ``` use std::env; fn main() -> std::io::Result<()> { let path = env::current_dir()?; println!("The current directory is {}", path.display()); Ok(()) } ``` rust Struct std::env::VarsOs Struct std::env::VarsOs ======================= ``` pub struct VarsOs { /* private fields */ } ``` An iterator over a snapshot of the environment variables of this process. This structure is created by [`env::vars_os()`](fn.vars_os). See its documentation for more. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#197-201)1.16.0 · ### impl Debug for VarsOs [source](https://doc.rust-lang.org/src/std/env.rs.html#198-200)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#186-194)### impl Iterator for VarsOs #### type Item = (OsString, OsString) The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/env.rs.html#188-190)#### fn next(&mut self) -> Option<(OsString, OsString)> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/std/env.rs.html#191-193)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for VarsOs ### impl !Send for VarsOs ### impl !Sync for VarsOs ### impl Unpin for VarsOs ### impl UnwindSafe for VarsOs Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::env::args Function std::env::args ======================= ``` pub fn args() -> ArgsⓘNotable traits for Argsimpl Iterator for Args type Item = String; ``` Returns the arguments that this program was started with (normally passed via the command line). The first element is traditionally the path of the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not be relied upon for security purposes. On Unix systems the shell usually expands unquoted arguments with glob patterns (such as `*` and `?`). On Windows this is not done, and such arguments are passed as-is. On glibc Linux systems, arguments are retrieved by placing a function in `.init_array`. glibc passes `argc`, `argv`, and `envp` to functions in `.init_array`, as a non-standard extension. This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it does on macOS and Windows. Panics ------ The returned iterator will panic during iteration if any argument to the process is not valid Unicode. If this is not desired, use the [`args_os`](fn.args_os "args_os") function instead. Examples -------- ``` use std::env; // Prints each argument on a separate line for argument in env::args() { println!("{argument}"); } ``` rust Struct std::env::Vars Struct std::env::Vars ===================== ``` pub struct Vars { /* private fields */ } ``` An iterator over a snapshot of the environment variables of this process. This structure is created by [`env::vars()`](fn.vars). See its documentation for more. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#179-183)1.16.0 · ### impl Debug for Vars [source](https://doc.rust-lang.org/src/std/env.rs.html#180-182)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#168-176)### impl Iterator for Vars #### type Item = (String, String) The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/env.rs.html#170-172)#### fn next(&mut self) -> Option<(String, String)> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/std/env.rs.html#173-175)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for Vars ### impl !Send for Vars ### impl !Sync for Vars ### impl Unpin for Vars ### impl UnwindSafe for Vars Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Enum std::env::VarError Enum std::env::VarError ======================= ``` pub enum VarError { NotPresent, NotUnicode(OsString), } ``` The error type for operations interacting with environment variables. Possibly returned from [`env::var()`](fn.var). Variants -------- ### `NotPresent` The specified environment variable was not present in the current process’s environment. ### `NotUnicode([OsString](../ffi/struct.osstring "struct std::ffi::OsString"))` The specified environment variable was found, but it did not contain valid unicode data. The found data is returned as a payload of this variant. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl Clone for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#280)#### fn clone(&self) -> VarError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl Debug for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#280)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#296-305)### impl Display for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#297-304)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/env.rs.html#308-316)### impl Error for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#310-315)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)#### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl PartialEq<VarError> for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#280)#### fn eq(&self, other: &VarError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl Eq for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl StructuralEq for VarError [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl StructuralPartialEq for VarError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for VarError ### impl Send for VarError ### impl Sync for VarError ### impl Unpin for VarError ### impl UnwindSafe for VarError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Constant std::env::consts::ARCH Constant std::env::consts::ARCH =============================== ``` pub const ARCH: &'static str = _; ``` A string describing the architecture of the CPU that is currently in use. Some possible values: * x86 * x86\_64 * arm * aarch64 * m68k * mips * mips64 * powerpc * powerpc64 * riscv64 * s390x * sparc64 rust Module std::env::consts Module std::env::consts ======================= Constants associated with the current target Constants --------- [ARCH](constant.arch "std::env::consts::ARCH constant") A string describing the architecture of the CPU that is currently in use. [DLL\_EXTENSION](constant.dll_extension "std::env::consts::DLL_EXTENSION constant") Specifies the file extension used for shared libraries on this platform that goes after the dot. Example value is `so`. [DLL\_PREFIX](constant.dll_prefix "std::env::consts::DLL_PREFIX constant") Specifies the filename prefix used for shared libraries on this platform. Example value is `lib`. [DLL\_SUFFIX](constant.dll_suffix "std::env::consts::DLL_SUFFIX constant") Specifies the filename suffix used for shared libraries on this platform. Example value is `.so`. [EXE\_EXTENSION](constant.exe_extension "std::env::consts::EXE_EXTENSION constant") Specifies the file extension, if any, used for executable binaries on this platform. Example value is `exe`. [EXE\_SUFFIX](constant.exe_suffix "std::env::consts::EXE_SUFFIX constant") Specifies the filename suffix used for executable binaries on this platform. Example value is `.exe`. [FAMILY](constant.family "std::env::consts::FAMILY constant") The family of the operating system. Example value is `unix`. [OS](constant.os "std::env::consts::OS constant") A string describing the specific operating system in use. Example value is `linux`. rust Constant std::env::consts::DLL_SUFFIX Constant std::env::consts::DLL\_SUFFIX ====================================== ``` pub const DLL_SUFFIX: &'static str; ``` Specifies the filename suffix used for shared libraries on this platform. Example value is `.so`. Some possible values: * .so * .dylib * .dll rust Constant std::env::consts::FAMILY Constant std::env::consts::FAMILY ================================= ``` pub const FAMILY: &'static str; ``` The family of the operating system. Example value is `unix`. Some possible values: * unix * windows rust Constant std::env::consts::DLL_PREFIX Constant std::env::consts::DLL\_PREFIX ====================================== ``` pub const DLL_PREFIX: &'static str; ``` Specifies the filename prefix used for shared libraries on this platform. Example value is `lib`. Some possible values: * lib * `""` (an empty string) rust Constant std::env::consts::OS Constant std::env::consts::OS ============================= ``` pub const OS: &'static str; ``` A string describing the specific operating system in use. Example value is `linux`. Some possible values: * linux * macos * ios * freebsd * dragonfly * netbsd * openbsd * solaris * android * windows rust Constant std::env::consts::DLL_EXTENSION Constant std::env::consts::DLL\_EXTENSION ========================================= ``` pub const DLL_EXTENSION: &'static str; ``` Specifies the file extension used for shared libraries on this platform that goes after the dot. Example value is `so`. Some possible values: * so * dylib * dll rust Constant std::env::consts::EXE_SUFFIX Constant std::env::consts::EXE\_SUFFIX ====================================== ``` pub const EXE_SUFFIX: &'static str; ``` Specifies the filename suffix used for executable binaries on this platform. Example value is `.exe`. Some possible values: * .exe * .nexe * .pexe * `""` (an empty string) rust Constant std::env::consts::EXE_EXTENSION Constant std::env::consts::EXE\_EXTENSION ========================================= ``` pub const EXE_EXTENSION: &'static str; ``` Specifies the file extension, if any, used for executable binaries on this platform. Example value is `exe`. Some possible values: * exe * `""` (an empty string) rust Module std::isize Module std::isize ================= 👎Deprecating in a future Rust version: all constants in this module replaced by associated constants on `isize` Constants for the pointer-sized signed integer type. *[See also the `isize` primitive type](../primitive.isize "isize").* New code should use the associated constants directly on the primitive type. Constants --------- [MAX](constant.max "std::isize::MAX constant")Deprecation planned The largest value that can be represented by this integer type. Use [`isize::MAX`](../primitive.isize#associatedconstant.MAX "isize::MAX") instead. [MIN](constant.min "std::isize::MIN constant")Deprecation planned The smallest value that can be represented by this integer type. Use [`isize::MIN`](../primitive.isize#associatedconstant.MIN "isize::MIN") instead. rust Constant std::isize::MAX Constant std::isize::MAX ======================== ``` pub const MAX: isize = isize::MAX; // 9_223_372_036_854_775_807isize ``` 👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type The largest value that can be represented by this integer type. Use [`isize::MAX`](../primitive.isize#associatedconstant.MAX "isize::MAX") instead. Examples -------- ``` // deprecated way let max = std::isize::MAX; // intended way let max = isize::MAX; ``` rust Constant std::isize::MIN Constant std::isize::MIN ======================== ``` pub const MIN: isize = isize::MIN; // -9_223_372_036_854_775_808isize ``` 👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type The smallest value that can be represented by this integer type. Use [`isize::MIN`](../primitive.isize#associatedconstant.MIN "isize::MIN") instead. Examples -------- ``` // deprecated way let min = std::isize::MIN; // intended way let min = isize::MIN; ``` rust Struct std::cell::LazyCell Struct std::cell::LazyCell ========================== ``` pub struct LazyCell<T, F = fn() -> T> { /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) A value which is initialized on the first access. Examples -------- ``` #![feature(once_cell)] use std::cell::LazyCell; let lazy: LazyCell<i32> = LazyCell::new(|| { println!("initializing"); 92 }); println!("ready"); println!("{}", *lazy); println!("{}", *lazy); // Prints: // ready // initializing // 92 // 92 ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#34)### impl<T, F> LazyCell<T, F> [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#51)#### pub const fn new(init: F) -> LazyCell<T, F> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Creates a new lazy value with the given initializing function. ##### Examples ``` #![feature(once_cell)] use std::cell::LazyCell; let hello = "Hello, World!".to_string(); let lazy = LazyCell::new(|| hello.to_uppercase()); assert_eq!(&*lazy, "HELLO, WORLD!"); ``` [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#56)### impl<T, F> LazyCell<T, F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> T, [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#75)#### pub fn force(this: &LazyCell<T, F>) -> &T 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Forces the evaluation of this lazy value and returns a reference to the result. This is equivalent to the `Deref` impl, but is explicit. ##### Examples ``` #![feature(once_cell)] use std::cell::LazyCell; let lazy = LazyCell::new(|| 92); assert_eq!(LazyCell::force(&lazy), &92); assert_eq!(&*lazy, &92); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#100)### impl<T, F> Debug for LazyCell<T, F>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#101)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#92)### impl<T> Default for LazyCell<T, fn() -> T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#94)#### fn default() -> LazyCell<T, fn() -> T> Creates a new lazy value using `Default` as the initializing function. [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#84)### impl<T, F> Deref for LazyCell<T, F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> T, #### type Target = T The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#86)#### fn deref(&self) -> &T Dereferences the value. Auto Trait Implementations -------------------------- ### impl<T, F = fn() -> T> !RefUnwindSafe for LazyCell<T, F> ### impl<T, F> Send for LazyCell<T, F>where F: [Send](../marker/trait.send "trait std::marker::Send"), T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T, F = fn() -> T> !Sync for LazyCell<T, F> ### impl<T, F> Unpin for LazyCell<T, F>where F: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T, F> UnwindSafe for LazyCell<T, F>where F: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::cell::BorrowMutError Struct std::cell::BorrowMutError ================================ ``` #[non_exhaustive]pub struct BorrowMutError {} ``` An error returned by [`RefCell::try_borrow_mut`](struct.refcell#method.try_borrow_mut "RefCell::try_borrow_mut"). Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#665)### impl Debug for BorrowMutError [source](https://doc.rust-lang.org/src/core/cell.rs.html#666)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#677)### impl Display for BorrowMutError [source](https://doc.rust-lang.org/src/core/cell.rs.html#678)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/error.rs.html#473)### impl Error for BorrowMutError [source](https://doc.rust-lang.org/src/core/error.rs.html#475)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for BorrowMutError ### impl Send for BorrowMutError ### impl Sync for BorrowMutError ### impl Unpin for BorrowMutError ### impl UnwindSafe for BorrowMutError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::cell Module std::cell ================ Shareable mutable containers. Rust memory safety is based on this rule: Given an object `T`, it is only possible to have one of the following: * Having several immutable references (`&T`) to the object (also known as **aliasing**). * Having one mutable reference (`&mut T`) to the object (also known as **mutability**). This is enforced by the Rust compiler. However, there are situations where this rule is not flexible enough. Sometimes it is required to have multiple references to an object and yet mutate it. Shareable mutable containers exist to permit mutability in a controlled manner, even in the presence of aliasing. Both [`Cell<T>`](struct.cell "Cell<T>") and [`RefCell<T>`](struct.refcell "RefCell<T>") allow doing this in a single-threaded way. However, neither `Cell<T>` nor `RefCell<T>` are thread safe (they do not implement [`Sync`](../marker/trait.sync "Sync")). If you need to do aliasing and mutation between multiple threads it is possible to use [`Mutex<T>`](../sync/struct.mutex), [`RwLock<T>`](../sync/struct.rwlock) or [`atomic`](../sync/atomic/index) types. Values of the `Cell<T>` and `RefCell<T>` types may be mutated through shared references (i.e. the common `&T` type), whereas most Rust types can only be mutated through unique (`&mut T`) references. We say that `Cell<T>` and `RefCell<T>` provide ‘interior mutability’, in contrast with typical Rust types that exhibit ‘inherited mutability’. Cell types come in two flavors: `Cell<T>` and `RefCell<T>`. `Cell<T>` implements interior mutability by moving values in and out of the `Cell<T>`. To use references instead of values, one must use the `RefCell<T>` type, acquiring a write lock before mutating. `Cell<T>` provides methods to retrieve and change the current interior value: * For types that implement [`Copy`](../marker/trait.copy "Copy"), the [`get`](struct.cell#method.get) method retrieves the current interior value. * For types that implement [`Default`](../default/trait.default "Default"), the [`take`](struct.cell#method.take) method replaces the current interior value with [`Default::default()`](../default/trait.default#tymethod.default "Default::default()") and returns the replaced value. * For all types, the [`replace`](struct.cell#method.replace) method replaces the current interior value and returns the replaced value and the [`into_inner`](struct.cell#method.into_inner) method consumes the `Cell<T>` and returns the interior value. Additionally, the [`set`](struct.cell#method.set) method replaces the interior value, dropping the replaced value. `RefCell<T>` uses Rust’s lifetimes to implement ‘dynamic borrowing’, a process whereby one can claim temporary, exclusive, mutable access to the inner value. Borrows for `RefCell<T>`s are tracked ‘at runtime’, unlike Rust’s native reference types which are entirely tracked statically, at compile time. Because `RefCell<T>` borrows are dynamic it is possible to attempt to borrow a value that is already mutably borrowed; when this happens it results in thread panic. When to choose interior mutability ---------------------------------- The more common inherited mutability, where one must have unique access to mutate a value, is one of the key language elements that enables Rust to reason strongly about pointer aliasing, statically preventing crash bugs. Because of that, inherited mutability is preferred, and interior mutability is something of a last resort. Since cell types enable mutation where it would otherwise be disallowed though, there are occasions when interior mutability might be appropriate, or even *must* be used, e.g. * Introducing mutability ‘inside’ of something immutable * Implementation details of logically-immutable methods. * Mutating implementations of [`Clone`](../clone/trait.clone "Clone"). ### Introducing mutability ‘inside’ of something immutable Many shared smart pointer types, including [`Rc<T>`](../rc/struct.rc) and [`Arc<T>`](../sync/struct.arc), provide containers that can be cloned and shared between multiple parties. Because the contained values may be multiply-aliased, they can only be borrowed with `&`, not `&mut`. Without cells it would be impossible to mutate data inside of these smart pointers at all. It’s very common then to put a `RefCell<T>` inside shared pointer types to reintroduce mutability: ``` use std::cell::{RefCell, RefMut}; use std::collections::HashMap; use std::rc::Rc; fn main() { let shared_map: Rc<RefCell<_>> = Rc::new(RefCell::new(HashMap::new())); // Create a new block to limit the scope of the dynamic borrow { let mut map: RefMut<_> = shared_map.borrow_mut(); map.insert("africa", 92388); map.insert("kyoto", 11837); map.insert("piccadilly", 11826); map.insert("marbles", 38); } // Note that if we had not let the previous borrow of the cache fall out // of scope then the subsequent borrow would cause a dynamic thread panic. // This is the major hazard of using `RefCell`. let total: i32 = shared_map.borrow().values().sum(); println!("{total}"); } ``` Note that this example uses `Rc<T>` and not `Arc<T>`. `RefCell<T>`s are for single-threaded scenarios. Consider using [`RwLock<T>`](../sync/struct.rwlock) or [`Mutex<T>`](../sync/struct.mutex) if you need shared mutability in a multi-threaded situation. ### Implementation details of logically-immutable methods Occasionally it may be desirable not to expose in an API that there is mutation happening “under the hood”. This may be because logically the operation is immutable, but e.g., caching forces the implementation to perform mutation; or because you must employ mutation to implement a trait method that was originally defined to take `&self`. ``` use std::cell::RefCell; struct Graph { edges: Vec<(i32, i32)>, span_tree_cache: RefCell<Option<Vec<(i32, i32)>>> } impl Graph { fn minimum_spanning_tree(&self) -> Vec<(i32, i32)> { self.span_tree_cache.borrow_mut() .get_or_insert_with(|| self.calc_span_tree()) .clone() } fn calc_span_tree(&self) -> Vec<(i32, i32)> { // Expensive computation goes here vec![] } } ``` ### Mutating implementations of `Clone` This is simply a special - but common - case of the previous: hiding mutability for operations that appear to be immutable. The [`clone`](../clone/trait.clone#tymethod.clone) method is expected to not change the source value, and is declared to take `&self`, not `&mut self`. Therefore, any mutation that happens in the `clone` method must use cell types. For example, [`Rc<T>`](../rc/struct.rc) maintains its reference counts within a `Cell<T>`. ``` use std::cell::Cell; use std::ptr::NonNull; use std::process::abort; use std::marker::PhantomData; struct Rc<T: ?Sized> { ptr: NonNull<RcBox<T>>, phantom: PhantomData<RcBox<T>>, } struct RcBox<T: ?Sized> { strong: Cell<usize>, refcount: Cell<usize>, value: T, } impl<T: ?Sized> Clone for Rc<T> { fn clone(&self) -> Rc<T> { self.inc_strong(); Rc { ptr: self.ptr, phantom: PhantomData, } } } trait RcBoxPtr<T: ?Sized> { fn inner(&self) -> &RcBox<T>; fn strong(&self) -> usize { self.inner().strong.get() } fn inc_strong(&self) { self.inner() .strong .set(self.strong() .checked_add(1) .unwrap_or_else(|| abort() )); } } impl<T: ?Sized> RcBoxPtr<T> for Rc<T> { fn inner(&self) -> &RcBox<T> { unsafe { self.ptr.as_ref() } } } ``` Structs ------- [LazyCell](struct.lazycell "std::cell::LazyCell struct")Experimental A value which is initialized on the first access. [OnceCell](struct.oncecell "std::cell::OnceCell struct")Experimental A cell which can be written to only once. [SyncUnsafeCell](struct.syncunsafecell "std::cell::SyncUnsafeCell struct")Experimental [`UnsafeCell`](struct.unsafecell "UnsafeCell"), but [`Sync`](../marker/trait.sync "Sync"). [BorrowError](struct.borrowerror "std::cell::BorrowError struct") An error returned by [`RefCell::try_borrow`](struct.refcell#method.try_borrow "RefCell::try_borrow"). [BorrowMutError](struct.borrowmuterror "std::cell::BorrowMutError struct") An error returned by [`RefCell::try_borrow_mut`](struct.refcell#method.try_borrow_mut "RefCell::try_borrow_mut"). [Cell](struct.cell "std::cell::Cell struct") A mutable memory location. [Ref](struct.ref "std::cell::Ref struct") Wraps a borrowed reference to a value in a `RefCell` box. A wrapper type for an immutably borrowed value from a `RefCell<T>`. [RefCell](struct.refcell "std::cell::RefCell struct") A mutable memory location with dynamically checked borrow rules [RefMut](struct.refmut "std::cell::RefMut struct") A wrapper type for a mutably borrowed value from a `RefCell<T>`. [UnsafeCell](struct.unsafecell "std::cell::UnsafeCell struct") The core primitive for interior mutability in Rust. rust Struct std::cell::BorrowError Struct std::cell::BorrowError ============================= ``` #[non_exhaustive]pub struct BorrowError {} ``` An error returned by [`RefCell::try_borrow`](struct.refcell#method.try_borrow "RefCell::try_borrow"). Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#638)### impl Debug for BorrowError [source](https://doc.rust-lang.org/src/core/cell.rs.html#639)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#650)### impl Display for BorrowError [source](https://doc.rust-lang.org/src/core/cell.rs.html#651)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/error.rs.html#465)### impl Error for BorrowError [source](https://doc.rust-lang.org/src/core/error.rs.html#467)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for BorrowError ### impl Send for BorrowError ### impl Sync for BorrowError ### impl Unpin for BorrowError ### impl UnwindSafe for BorrowError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::cell::UnsafeCell Struct std::cell::UnsafeCell ============================ ``` #[repr(transparent)]pub struct UnsafeCell<T>where    T: ?Sized,{ /* private fields */ } ``` The core primitive for interior mutability in Rust. If you have a reference `&T`, then normally in Rust the compiler performs optimizations based on the knowledge that `&T` points to immutable data. Mutating that data, for example through an alias or by transmuting an `&T` into an `&mut T`, is considered undefined behavior. `UnsafeCell<T>` opts-out of the immutability guarantee for `&T`: a shared reference `&UnsafeCell<T>` may point to data that is being mutated. This is called “interior mutability”. All other types that allow internal mutability, such as `Cell<T>` and `RefCell<T>`, internally use `UnsafeCell` to wrap their data. Note that only the immutability guarantee for shared references is affected by `UnsafeCell`. The uniqueness guarantee for mutable references is unaffected. There is *no* legal way to obtain aliasing `&mut`, not even with `UnsafeCell<T>`. The `UnsafeCell` API itself is technically very simple: [`.get()`](struct.unsafecell#method.get) gives you a raw pointer `*mut T` to its contents. It is up to *you* as the abstraction designer to use that raw pointer correctly. The precise Rust aliasing rules are somewhat in flux, but the main points are not contentious: * If you create a safe reference with lifetime `'a` (either a `&T` or `&mut T` reference), then you must not access the data in any way that contradicts that reference for the remainder of `'a`. For example, this means that if you take the `*mut T` from an `UnsafeCell<T>` and cast it to an `&T`, then the data in `T` must remain immutable (modulo any `UnsafeCell` data found within `T`, of course) until that reference’s lifetime expires. Similarly, if you create a `&mut T` reference that is released to safe code, then you must not access the data within the `UnsafeCell` until that reference expires. * For both `&T` without `UnsafeCell<_>` and `&mut T`, you must also not deallocate the data until the reference expires. As a special exception, given an `&T`, any part of it that is inside an `UnsafeCell<_>` may be deallocated during the lifetime of the reference, after the last time the reference is used (dereferenced or reborrowed). Since you cannot deallocate a part of what a reference points to, this means the memory an `&T` points to can be deallocted only if *every part of it* (including padding) is inside an `UnsafeCell`. However, whenever a `&UnsafeCell<T>` is constructed or dereferenced, it must still point to live memory and the compiler is allowed to insert spurious reads if it can prove that this memory has not yet been deallocated. * At all times, you must avoid data races. If multiple threads have access to the same `UnsafeCell`, then any writes must have a proper happens-before relation to all other accesses (or use atomics). To assist with proper design, the following scenarios are explicitly declared legal for single-threaded code: 1. A `&T` reference can be released to safe code and there it can co-exist with other `&T` references, but not with a `&mut T` 2. A `&mut T` reference may be released to safe code provided neither other `&mut T` nor `&T` co-exist with it. A `&mut T` must always be unique. Note that whilst mutating the contents of an `&UnsafeCell<T>` (even while other `&UnsafeCell<T>` references alias the cell) is ok (provided you enforce the above invariants some other way), it is still undefined behavior to have multiple `&mut UnsafeCell<T>` aliases. That is, `UnsafeCell` is a wrapper designed to have a special interaction with *shared* accesses (*i.e.*, through an `&UnsafeCell<_>` reference); there is no magic whatsoever when dealing with *exclusive* accesses (*e.g.*, through an `&mut UnsafeCell<_>`): neither the cell nor the wrapped value may be aliased for the duration of that `&mut` borrow. This is showcased by the [`.get_mut()`](struct.unsafecell#method.get_mut) accessor, which is a *safe* getter that yields a `&mut T`. Examples -------- Here is an example showcasing how to soundly mutate the contents of an `UnsafeCell<_>` despite there being multiple references aliasing the cell: ``` use std::cell::UnsafeCell; let x: UnsafeCell<i32> = 42.into(); // Get multiple / concurrent / shared references to the same `x`. let (p1, p2): (&UnsafeCell<i32>, &UnsafeCell<i32>) = (&x, &x); unsafe { // SAFETY: within this scope there are no other references to `x`'s contents, // so ours is effectively unique. let p1_exclusive: &mut i32 = &mut *p1.get(); // -- borrow --+ *p1_exclusive += 27; // | } // <---------- cannot go beyond this point -------------------+ unsafe { // SAFETY: within this scope nobody expects to have exclusive access to `x`'s contents, // so we can have multiple shared accesses concurrently. let p2_shared: &i32 = &*p2.get(); assert_eq!(*p2_shared, 42 + 27); let p1_shared: &i32 = &*p1.get(); assert_eq!(*p1_shared, *p2_shared); } ``` The following example showcases the fact that exclusive access to an `UnsafeCell<T>` implies exclusive access to its `T`: ``` #![forbid(unsafe_code)] // with exclusive accesses, // `UnsafeCell` is a transparent no-op wrapper, // so no need for `unsafe` here. use std::cell::UnsafeCell; let mut x: UnsafeCell<i32> = 42.into(); // Get a compile-time-checked unique reference to `x`. let p_unique: &mut UnsafeCell<i32> = &mut x; // With an exclusive reference, we can mutate the contents for free. *p_unique.get_mut() = 0; // Or, equivalently: x = UnsafeCell::new(0); // When we own the value, we can extract the contents for free. let contents: i32 = x.into_inner(); assert_eq!(contents, 0); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#1875)### impl<T> UnsafeCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#1891)const: 1.32.0 · #### pub const fn new(value: T) -> UnsafeCell<T> Constructs a new instance of `UnsafeCell` which will wrap the specified value. All access to the inner value through methods is `unsafe`. ##### Examples ``` use std::cell::UnsafeCell; let uc = UnsafeCell::new(5); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1909)const: [unstable](https://github.com/rust-lang/rust/issues/78729 "Tracking issue for const_cell_into_inner") · #### pub fn into\_inner(self) -> T Unwraps the value. ##### Examples ``` use std::cell::UnsafeCell; let uc = UnsafeCell::new(5); let five = uc.into_inner(); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1914)### impl<T> UnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1934)const: 1.32.0 · #### pub const fn get(&self) -> \*mut T Gets a mutable pointer to the wrapped value. This can be cast to a pointer of any kind. Ensure that the access is unique (no active references, mutable or not) when casting to `&mut T`, and ensure that there are no mutations or mutable aliases going on when casting to `&T` ##### Examples ``` use std::cell::UnsafeCell; let uc = UnsafeCell::new(5); let five = uc.get(); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1959)1.50.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88836 "Tracking issue for const_unsafecell_get_mut")) · #### pub fn get\_mut(&mut self) -> &mut T Returns a mutable reference to the underlying data. This call borrows the `UnsafeCell` mutably (at compile-time) which guarantees that we possess the only reference. ##### Examples ``` use std::cell::UnsafeCell; let mut c = UnsafeCell::new(5); *c.get_mut() += 1; assert_eq!(*c.get_mut(), 6); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1992)1.56.0 (const: 1.56.0) · #### pub const fn raw\_get(this: \*const UnsafeCell<T>) -> \*mut T Gets a mutable pointer to the wrapped value. The difference from [`get`](struct.unsafecell#method.get) is that this function accepts a raw pointer, which is useful to avoid the creation of temporary references. The result can be cast to a pointer of any kind. Ensure that the access is unique (no active references, mutable or not) when casting to `&mut T`, and ensure that there are no mutations or mutable aliases going on when casting to `&T`. ##### Examples Gradual initialization of an `UnsafeCell` requires `raw_get`, as calling `get` would require creating a reference to uninitialized data: ``` use std::cell::UnsafeCell; use std::mem::MaybeUninit; let m = MaybeUninit::<UnsafeCell<i32>>::uninit(); unsafe { UnsafeCell::raw_get(m.as_ptr()).write(5); } let uc = unsafe { m.assume_init() }; assert_eq!(uc.into_inner(), 5); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2654)1.9.0 · ### impl<T> Debug for UnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2655)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#2001)1.10.0 · ### impl<T> Default for UnsafeCell<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#2003)#### fn default() -> UnsafeCell<T> Creates an `UnsafeCell`, with the `Default` value for T. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2010)1.12.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<T> From<T> for UnsafeCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#2012)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> UnsafeCell<T> Creates a new `UnsafeCell<T>` containing the given value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2018)### impl<T, U> CoerceUnsized<UnsafeCell<U>> for UnsafeCell<T>where T: [CoerceUnsized](../ops/trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#200)1.9.0 · ### impl<T> !RefUnwindSafe for UnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1873)### impl<T> !Sync for UnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<T: ?Sized> Send for UnsafeCell<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T: ?Sized> Unpin for UnsafeCell<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T: ?Sized> UnwindSafe for UnsafeCell<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::cell::SyncUnsafeCell Struct std::cell::SyncUnsafeCell ================================ ``` #[repr(transparent)]pub struct SyncUnsafeCell<T>where    T: ?Sized,{ /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`sync_unsafe_cell` [#95439](https://github.com/rust-lang/rust/issues/95439)) [`UnsafeCell`](struct.unsafecell "UnsafeCell"), but [`Sync`](../marker/trait.sync "Sync"). This is just an `UnsafeCell`, except it implements `Sync` if `T` implements `Sync`. `UnsafeCell` doesn’t implement `Sync`, to prevent accidental mis-use. You can use `SyncUnsafeCell` instead of `UnsafeCell` to allow it to be shared between threads, if that’s intentional. Providing proper synchronization is still the task of the user, making this type just as unsafe to use. See [`UnsafeCell`](struct.unsafecell "UnsafeCell") for details. Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#2042)### impl<T> SyncUnsafeCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#2045)#### pub const fn new(value: T) -> SyncUnsafeCell<T> 🔬This is a nightly-only experimental API. (`sync_unsafe_cell` [#95439](https://github.com/rust-lang/rust/issues/95439)) Constructs a new instance of `SyncUnsafeCell` which will wrap the specified value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2051)#### pub const fn into\_inner(self) -> T 🔬This is a nightly-only experimental API. (`sync_unsafe_cell` [#95439](https://github.com/rust-lang/rust/issues/95439)) Unwraps the value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2057)### impl<T> SyncUnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#2065)#### pub const fn get(&self) -> \*mut T 🔬This is a nightly-only experimental API. (`sync_unsafe_cell` [#95439](https://github.com/rust-lang/rust/issues/95439)) Gets a mutable pointer to the wrapped value. This can be cast to a pointer of any kind. Ensure that the access is unique (no active references, mutable or not) when casting to `&mut T`, and ensure that there are no mutations or mutable aliases going on when casting to `&T` [source](https://doc.rust-lang.org/src/core/cell.rs.html#2074)#### pub const fn get\_mut(&mut self) -> &mut T 🔬This is a nightly-only experimental API. (`sync_unsafe_cell` [#95439](https://github.com/rust-lang/rust/issues/95439)) Returns a mutable reference to the underlying data. This call borrows the `SyncUnsafeCell` mutably (at compile-time) which guarantees that we possess the only reference. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2082)#### pub const fn raw\_get(this: \*const SyncUnsafeCell<T>) -> \*mut T 🔬This is a nightly-only experimental API. (`sync_unsafe_cell` [#95439](https://github.com/rust-lang/rust/issues/95439)) Gets a mutable pointer to the wrapped value. See [`UnsafeCell::get`](struct.unsafecell#method.get "UnsafeCell::get") for details. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2661)### impl<T> Debug for SyncUnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2662)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#2091)### impl<T> Default for SyncUnsafeCell<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#2093)#### fn default() -> SyncUnsafeCell<T> Creates an `SyncUnsafeCell`, with the `Default` value for T. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2100)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> From<T> for SyncUnsafeCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#2102)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> SyncUnsafeCell<T> Creates a new `SyncUnsafeCell<T>` containing the given value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#2109)### impl<T, U> CoerceUnsized<SyncUnsafeCell<U>> for SyncUnsafeCell<T>where T: [CoerceUnsized](../ops/trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/cell.rs.html#2039)### impl<T> Sync for SyncUnsafeCell<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<T> !RefUnwindSafe for SyncUnsafeCell<T> ### impl<T: ?Sized> Send for SyncUnsafeCell<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T: ?Sized> Unpin for SyncUnsafeCell<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T: ?Sized> UnwindSafe for SyncUnsafeCell<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::cell::Cell Struct std::cell::Cell ====================== ``` #[repr(transparent)]pub struct Cell<T>where    T: ?Sized,{ /* private fields */ } ``` A mutable memory location. Examples -------- In this example, you can see that `Cell<T>` enables mutation inside an immutable struct. In other words, it enables “interior mutability”. ``` use std::cell::Cell; struct SomeStruct { regular_field: u8, special_field: Cell<u8>, } let my_struct = SomeStruct { regular_field: 0, special_field: Cell::new(1), }; let new_value = 100; // ERROR: `my_struct` is immutable // my_struct.regular_field = new_value; // WORKS: although `my_struct` is immutable, `special_field` is a `Cell`, // which can always be mutated my_struct.special_field.set(new_value); assert_eq!(my_struct.special_field.get(), new_value); ``` See the [module-level documentation](index) for more. Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#332)### impl<T> Cell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#345)const: 1.24.0 · #### pub const fn new(value: T) -> Cell<T> Creates a new `Cell` containing the given value. ##### Examples ``` use std::cell::Cell; let c = Cell::new(5); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#362)#### pub fn set(&self, val: T) Sets the contained value. ##### Examples ``` use std::cell::Cell; let c = Cell::new(5); c.set(10); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#383)1.17.0 · #### pub fn swap(&self, other: &Cell<T>) Swaps the values of two `Cell`s. Difference with `std::mem::swap` is that this function doesn’t require `&mut` reference. ##### Examples ``` use std::cell::Cell; let c1 = Cell::new(5i32); let c2 = Cell::new(10i32); c1.swap(&c2); assert_eq!(10, c1.get()); assert_eq!(5, c2.get()); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#409)1.17.0 · #### pub fn replace(&self, val: T) -> T Replaces the contained value with `val`, and returns the old contained value. ##### Examples ``` use std::cell::Cell; let cell = Cell::new(5); assert_eq!(cell.get(), 5); assert_eq!(cell.replace(10), 5); assert_eq!(cell.get(), 10); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#429)1.17.0 (const: [unstable](https://github.com/rust-lang/rust/issues/78729 "Tracking issue for const_cell_into_inner")) · #### pub fn into\_inner(self) -> T Unwraps the value. ##### Examples ``` use std::cell::Cell; let c = Cell::new(5); let five = c.into_inner(); assert_eq!(five, 5); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#434)### impl<T> Cell<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#448)#### pub fn get(&self) -> T Returns a copy of the contained value. ##### Examples ``` use std::cell::Cell; let c = Cell::new(5); let five = c.get(); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#471-473)#### pub fn update<F>(&self, f: F) -> Twhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> T, 🔬This is a nightly-only experimental API. (`cell_update` [#50186](https://github.com/rust-lang/rust/issues/50186)) Updates the contained value using a function and returns the new value. ##### Examples ``` #![feature(cell_update)] use std::cell::Cell; let c = Cell::new(5); let new = c.update(|x| x + 1); assert_eq!(new, 6); assert_eq!(c.get(), 6); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#482)### impl<T> Cell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#497)1.12.0 (const: 1.32.0) · #### pub const fn as\_ptr(&self) -> \*mut T Returns a raw pointer to the underlying data in this cell. ##### Examples ``` use std::cell::Cell; let c = Cell::new(5); let ptr = c.as_ptr(); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#525)1.11.0 · #### pub fn get\_mut(&mut self) -> &mut T Returns a mutable reference to the underlying data. This call borrows `Cell` mutably (at compile-time) which guarantees that we possess the only reference. However be cautious: this method expects `self` to be mutable, which is generally not the case when using a `Cell`. If you require interior mutability by reference, consider using `RefCell` which provides run-time checked mutable borrows through its [`borrow_mut`](struct.refcell#method.borrow_mut) method. ##### Examples ``` use std::cell::Cell; let mut c = Cell::new(5); *c.get_mut() += 1; assert_eq!(c.get(), 6); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#544)1.37.0 · #### pub fn from\_mut(t: &mut T) -> &Cell<T> Returns a `&Cell<T>` from a `&mut T` ##### Examples ``` use std::cell::Cell; let slice: &mut [i32] = &mut [1, 2, 3]; let cell_slice: &Cell<[i32]> = Cell::from_mut(slice); let slice_cell: &[Cell<i32>] = cell_slice.as_slice_of_cells(); assert_eq!(slice_cell.len(), 3); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#550)### impl<T> Cell<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#565)1.17.0 · #### pub fn take(&self) -> T Takes the value of the cell, leaving `Default::default()` in its place. ##### Examples ``` use std::cell::Cell; let c = Cell::new(5); let five = c.take(); assert_eq!(five, 5); assert_eq!(c.into_inner(), 0); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#573)### impl<T> Cell<[T]> [source](https://doc.rust-lang.org/src/core/cell.rs.html#588)1.37.0 · #### pub fn as\_slice\_of\_cells(&self) -> &[Cell<T>] Returns a `&[Cell<T>]` from a `&Cell<[T]>` ##### Examples ``` use std::cell::Cell; let slice: &mut [i32] = &mut [1, 2, 3]; let cell_slice: &Cell<[i32]> = Cell::from_mut(slice); let slice_cell: &[Cell<i32>] = cell_slice.as_slice_of_cells(); assert_eq!(slice_cell.len(), 3); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#594)### impl<T, const N: usize> Cell<[T; N]> [source](https://doc.rust-lang.org/src/core/cell.rs.html#608)#### pub fn as\_array\_of\_cells(&self) -> &[Cell<T>; N] 🔬This is a nightly-only experimental API. (`as_array_of_cells` [#88248](https://github.com/rust-lang/rust/issues/88248)) Returns a `&[Cell<T>; N]` from a `&Cell<[T; N]>` ##### Examples ``` #![feature(as_array_of_cells)] use std::cell::Cell; let mut array: [i32; 3] = [1, 2, 3]; let cell_array: &Cell<[i32; 3]> = Cell::from_mut(&mut array); let array_cell: &[Cell<i32>; 3] = cell_array.as_array_of_cells(); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#260)### impl<T> Clone for Cell<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#262)#### fn clone(&self) -> Cell<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2611)### impl<T> Debug for Cell<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy") + [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2612)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#268)### impl<T> Default for Cell<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#271)#### fn default() -> Cell<T> Creates a `Cell<T>`, with the `Default` value for T. [source](https://doc.rust-lang.org/src/core/cell.rs.html#325)1.12.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<T> From<T> for Cell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#327)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> Cell<T> Creates a new `Cell<T>` containing the given value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#316)1.10.0 · ### impl<T> Ord for Cell<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#318)#### fn cmp(&self, other: &Cell<T>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/cell.rs.html#277)### impl<T> PartialEq<Cell<T>> for Cell<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T> + [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#279)#### fn eq(&self, other: &Cell<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/cell.rs.html#288)1.10.0 · ### impl<T> PartialOrd<Cell<T>> for Cell<T>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#290)#### fn partial\_cmp(&self, other: &Cell<T>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cell.rs.html#295)#### fn lt(&self, other: &Cell<T>) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#300)#### fn le(&self, other: &Cell<T>) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cell.rs.html#305)#### fn gt(&self, other: &Cell<T>) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#310)#### fn ge(&self, other: &Cell<T>) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/cell.rs.html#571)### impl<T, U> CoerceUnsized<Cell<U>> for Cell<T>where T: [CoerceUnsized](../ops/trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/cell.rs.html#285)1.2.0 · ### impl<T> Eq for Cell<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#249)### impl<T> Send for Cell<T>where T: [Send](../marker/trait.send "trait std::marker::Send") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#257)### impl<T> !Sync for Cell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<T> !RefUnwindSafe for Cell<T> ### impl<T: ?Sized> Unpin for Cell<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T: ?Sized> UnwindSafe for Cell<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::cell::RefCell Struct std::cell::RefCell ========================= ``` pub struct RefCell<T>where    T: ?Sized,{ /* private fields */ } ``` A mutable memory location with dynamically checked borrow rules See the [module-level documentation](index) for more. Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#709)### impl<T> RefCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#722)const: 1.24.0 · #### pub const fn new(value: T) -> RefCell<T> Creates a new `RefCell` containing `value`. ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#745)const: [unstable](https://github.com/rust-lang/rust/issues/78729 "Tracking issue for const_cell_into_inner") · #### pub fn into\_inner(self) -> T Consumes the `RefCell`, returning the wrapped value. ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); let five = c.into_inner(); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#772)1.24.0 · #### pub fn replace(&self, t: T) -> T Replaces the wrapped value with a new one, returning the old value, without deinitializing either one. This function corresponds to [`std::mem::replace`](../mem/fn.replace). ##### Panics Panics if the value is currently borrowed. ##### Examples ``` use std::cell::RefCell; let cell = RefCell::new(5); let old_value = cell.replace(6); assert_eq!(old_value, 5); assert_eq!(cell, RefCell::new(6)); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#795)1.35.0 · #### pub fn replace\_with<F>(&self, f: F) -> Twhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&mut](../primitive.reference) T) -> T, Replaces the wrapped value with a new one computed from `f`, returning the old value, without deinitializing either one. ##### Panics Panics if the value is currently borrowed. ##### Examples ``` use std::cell::RefCell; let cell = RefCell::new(5); let old_value = cell.replace_with(|&mut old| old + 1); assert_eq!(old_value, 5); assert_eq!(cell, RefCell::new(6)); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#822)1.24.0 · #### pub fn swap(&self, other: &RefCell<T>) Swaps the wrapped value of `self` with the wrapped value of `other`, without deinitializing either one. This function corresponds to [`std::mem::swap`](../mem/fn.swap). ##### Panics Panics if the value in either `RefCell` is currently borrowed. ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); let d = RefCell::new(6); c.swap(&d); assert_eq!(c, RefCell::new(6)); assert_eq!(d, RefCell::new(5)); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#827)### impl<T> RefCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#862)#### pub fn borrow(&self) -> Ref<'\_, T> Immutably borrows the wrapped value. The borrow lasts until the returned `Ref` exits scope. Multiple immutable borrows can be taken out at the same time. ##### Panics Panics if the value is currently mutably borrowed. For a non-panicking variant, use [`try_borrow`](#method.try_borrow). ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); let borrowed_five = c.borrow(); let borrowed_five2 = c.borrow(); ``` An example of panic: ⓘ ``` use std::cell::RefCell; let c = RefCell::new(5); let m = c.borrow_mut(); let b = c.borrow(); // this causes a panic ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#894)1.13.0 · #### pub fn try\_borrow(&self) -> Result<Ref<'\_, T>, BorrowError> Immutably borrows the wrapped value, returning an error if the value is currently mutably borrowed. The borrow lasts until the returned `Ref` exits scope. Multiple immutable borrows can be taken out at the same time. This is the non-panicking variant of [`borrow`](#method.borrow). ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); { let m = c.borrow_mut(); assert!(c.try_borrow().is_err()); } { let m = c.borrow(); assert!(c.try_borrow().is_ok()); } ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#955)#### pub fn borrow\_mut(&self) -> RefMut<'\_, T> Mutably borrows the wrapped value. The borrow lasts until the returned `RefMut` or all `RefMut`s derived from it exit scope. The value cannot be borrowed while this borrow is active. ##### Panics Panics if the value is currently borrowed. For a non-panicking variant, use [`try_borrow_mut`](#method.try_borrow_mut). ##### Examples ``` use std::cell::RefCell; let c = RefCell::new("hello".to_owned()); *c.borrow_mut() = "bonjour".to_owned(); assert_eq!(&*c.borrow(), "bonjour"); ``` An example of panic: ⓘ ``` use std::cell::RefCell; let c = RefCell::new(5); let m = c.borrow(); let b = c.borrow_mut(); // this causes a panic ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#984)1.13.0 · #### pub fn try\_borrow\_mut(&self) -> Result<RefMut<'\_, T>, BorrowMutError> Mutably borrows the wrapped value, returning an error if the value is currently borrowed. The borrow lasts until the returned `RefMut` or all `RefMut`s derived from it exit scope. The value cannot be borrowed while this borrow is active. This is the non-panicking variant of [`borrow_mut`](#method.borrow_mut). ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); { let m = c.borrow(); assert!(c.try_borrow_mut().is_err()); } assert!(c.try_borrow_mut().is_ok()); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1018)1.12.0 · #### pub fn as\_ptr(&self) -> \*mut T Returns a raw pointer to the underlying data in this cell. ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); let ptr = c.as_ptr(); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1048)1.11.0 · #### pub fn get\_mut(&mut self) -> &mut T Returns a mutable reference to the underlying data. This call borrows `RefCell` mutably (at compile-time) so there is no need for dynamic checks. However be cautious: this method expects `self` to be mutable, which is generally not the case when using a `RefCell`. Take a look at the [`borrow_mut`](struct.refcell#method.borrow_mut) method instead if `self` isn’t mutable. Also, please be aware that this method is only for special circumstances and is usually not what you want. In case of doubt, use [`borrow_mut`](struct.refcell#method.borrow_mut) instead. ##### Examples ``` use std::cell::RefCell; let mut c = RefCell::new(5); *c.get_mut() += 1; assert_eq!(c, RefCell::new(6)); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1074)#### pub fn undo\_leak(&mut self) -> &mut T 🔬This is a nightly-only experimental API. (`cell_leak` [#69099](https://github.com/rust-lang/rust/issues/69099)) Undo the effect of leaked guards on the borrow state of the `RefCell`. This call is similar to [`get_mut`](struct.refcell#method.get_mut) but more specialized. It borrows `RefCell` mutably to ensure no borrows exist and then resets the state tracking shared borrows. This is relevant if some `Ref` or `RefMut` borrows have been leaked. ##### Examples ``` #![feature(cell_leak)] use std::cell::RefCell; let mut c = RefCell::new(0); std::mem::forget(c.borrow_mut()); assert!(c.try_borrow().is_err()); c.undo_leak(); assert!(c.try_borrow().is_ok()); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1108)1.37.0 · #### pub unsafe fn try\_borrow\_unguarded(&self) -> Result<&T, BorrowError> Immutably borrows the wrapped value, returning an error if the value is currently mutably borrowed. ##### Safety Unlike `RefCell::borrow`, this method is unsafe because it does not return a `Ref`, thus leaving the borrow flag untouched. Mutably borrowing the `RefCell` while the reference returned by this method is alive is undefined behaviour. ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); { let m = c.borrow_mut(); assert!(unsafe { c.try_borrow_unguarded() }.is_err()); } { let m = c.borrow(); assert!(unsafe { c.try_borrow_unguarded() }.is_ok()); } ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1127)### impl<T> RefCell<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1146)1.50.0 · #### pub fn take(&self) -> T Takes the wrapped value, leaving `Default::default()` in its place. ##### Panics Panics if the value is currently borrowed. ##### Examples ``` use std::cell::RefCell; let c = RefCell::new(5); let five = c.take(); assert_eq!(five, 5); assert_eq!(c.into_inner(), 0); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#1158)### impl<T> Clone for RefCell<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1164)#### fn clone(&self) -> RefCell<T> ##### Panics Panics if the value is currently mutably borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1173)#### fn clone\_from(&mut self, other: &RefCell<T>) ##### Panics Panics if `other` is currently mutably borrowed. [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2618)### impl<T> Debug for RefCell<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2619)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#1179)### impl<T> Default for RefCell<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1182)#### fn default() -> RefCell<T> Creates a `RefCell<T>`, with the `Default` value for T. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1257)1.12.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<T> From<T> for RefCell<T> [source](https://doc.rust-lang.org/src/core/cell.rs.html#1259)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> RefCell<T> Creates a new `RefCell<T>` containing the given value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1245)1.10.0 · ### impl<T> Ord for RefCell<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1250)#### fn cmp(&self, other: &RefCell<T>) -> Ordering ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1188)### impl<T> PartialEq<RefCell<T>> for RefCell<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1193)#### fn eq(&self, other: &RefCell<T>) -> bool ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/cell.rs.html#1202)1.10.0 · ### impl<T> PartialOrd<RefCell<T>> for RefCell<T>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1207)#### fn partial\_cmp(&self, other: &RefCell<T>) -> Option<Ordering> ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1215)#### fn lt(&self, other: &RefCell<T>) -> bool ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1223)#### fn le(&self, other: &RefCell<T>) -> bool ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1231)#### fn gt(&self, other: &RefCell<T>) -> bool ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1239)#### fn ge(&self, other: &RefCell<T>) -> bool ##### Panics Panics if the value in either `RefCell` is currently borrowed. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1265)### impl<T, U> CoerceUnsized<RefCell<U>> for RefCell<T>where T: [CoerceUnsized](../ops/trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/cell.rs.html#1199)1.2.0 · ### impl<T> Eq for RefCell<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1152)### impl<T> Send for RefCell<T>where T: [Send](../marker/trait.send "trait std::marker::Send") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1155)### impl<T> !Sync for RefCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<T> !RefUnwindSafe for RefCell<T> ### impl<T: ?Sized> Unpin for RefCell<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T: ?Sized> UnwindSafe for RefCell<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::cell::Ref Struct std::cell::Ref ===================== ``` pub struct Ref<'b, T>where    T: 'b + ?Sized,{ /* private fields */ } ``` Wraps a borrowed reference to a value in a `RefCell` box. A wrapper type for an immutably borrowed value from a `RefCell<T>`. See the [module-level documentation](index) for more. Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#1345)### impl<'b, T> Ref<'b, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1357)1.15.0 · #### pub fn clone(orig: &Ref<'b, T>) -> Ref<'b, T> Copies a `Ref`. The `RefCell` is already immutably borrowed, so this cannot fail. This is an associated function that needs to be used as `Ref::clone(...)`. A `Clone` implementation or a method would interfere with the widespread use of `r.borrow().clone()` to clone the contents of a `RefCell`. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1381-1383)1.8.0 · #### pub fn map<U, F>(orig: Ref<'b, T>, f: F) -> Ref<'b, U>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&](../primitive.reference)T) -> [&](../primitive.reference)U, U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Makes a new `Ref` for a component of the borrowed data. The `RefCell` is already immutably borrowed, so this cannot fail. This is an associated function that needs to be used as `Ref::map(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` use std::cell::{RefCell, Ref}; let c = RefCell::new((5, 'b')); let b1: Ref<(u32, char)> = c.borrow(); let b2: Ref<u32> = Ref::map(b1, |t| &t.0); assert_eq!(*b2, 5) ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1410-1412)1.63.0 · #### pub fn filter\_map<U, F>(orig: Ref<'b, T>, f: F) -> Result<Ref<'b, U>, Ref<'b, T>>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&](../primitive.reference)T) -> [Option](../option/enum.option "enum std::option::Option")<[&](../primitive.reference)U>, U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Makes a new `Ref` for an optional component of the borrowed data. The original guard is returned as an `Err(..)` if the closure returns `None`. The `RefCell` is already immutably borrowed, so this cannot fail. This is an associated function that needs to be used as `Ref::filter_map(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` use std::cell::{RefCell, Ref}; let c = RefCell::new(vec![1, 2, 3]); let b1: Ref<Vec<u32>> = c.borrow(); let b2: Result<Ref<u32>, _> = Ref::filter_map(b1, |v| v.get(1)); assert_eq!(*b2.unwrap(), 2); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1442-1444)1.35.0 · #### pub fn map\_split<U, V, F>(orig: Ref<'b, T>, f: F) -> (Ref<'b, U>, Ref<'b, V>)where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&](../primitive.reference)T) -> ([&](../primitive.reference)U, [&](../primitive.reference)V), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), V: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Splits a `Ref` into multiple `Ref`s for different components of the borrowed data. The `RefCell` is already immutably borrowed, so this cannot fail. This is an associated function that needs to be used as `Ref::map_split(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` use std::cell::{Ref, RefCell}; let cell = RefCell::new([1, 2, 3, 4]); let borrow = cell.borrow(); let (begin, end) = Ref::map_split(borrow, |slice| slice.split_at(2)); assert_eq!(*begin, [1, 2]); assert_eq!(*end, [3, 4]); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1479)#### pub fn leak(orig: Ref<'b, T>) -> &'b T 🔬This is a nightly-only experimental API. (`cell_leak` [#69099](https://github.com/rust-lang/rust/issues/69099)) Convert into a reference to the underlying data. The underlying `RefCell` can never be mutably borrowed from again and will always appear already immutably borrowed. It is not a good idea to leak more than a constant number of references. The `RefCell` can be immutably borrowed again if only a smaller number of leaks have occurred in total. This is an associated function that needs to be used as `Ref::leak(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` #![feature(cell_leak)] use std::cell::{RefCell, Ref}; let cell = RefCell::new(0); let value = Ref::leak(cell.borrow()); assert_eq!(*value, 0); assert!(cell.try_borrow().is_ok()); assert!(cell.try_borrow_mut().is_err()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2640)### impl<T> Debug for Ref<'\_, T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2641)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#1335)### impl<T> Deref for Ref<'\_, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1339)#### fn deref(&self) -> &T Dereferences the value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1494)1.20.0 · ### impl<T> Display for Ref<'\_, T>where T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1495)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#1491)### impl<'b, T, U> CoerceUnsized<Ref<'b, U>> for Ref<'b, T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<'b, T> !RefUnwindSafe for Ref<'b, T> ### impl<'b, T> !Send for Ref<'b, T> ### impl<'b, T> !Sync for Ref<'b, T> ### impl<'b, T: ?Sized> Unpin for Ref<'b, T> ### impl<'b, T> !UnwindSafe for Ref<'b, T> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::cell::RefMut Struct std::cell::RefMut ======================== ``` pub struct RefMut<'b, T>where    T: 'b + ?Sized,{ /* private fields */ } ``` A wrapper type for a mutably borrowed value from a `RefCell<T>`. See the [module-level documentation](index) for more. Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell.rs.html#1500)### impl<'b, T> RefMut<'b, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1526-1528)1.8.0 · #### pub fn map<U, F>(orig: RefMut<'b, T>, f: F) -> RefMut<'b, U>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&mut](../primitive.reference) T) -> [&mut](../primitive.reference) U, U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Makes a new `RefMut` for a component of the borrowed data, e.g., an enum variant. The `RefCell` is already mutably borrowed, so this cannot fail. This is an associated function that needs to be used as `RefMut::map(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` use std::cell::{RefCell, RefMut}; let c = RefCell::new((5, 'b')); { let b1: RefMut<(u32, char)> = c.borrow_mut(); let mut b2: RefMut<u32> = RefMut::map(b1, |t| &mut t.0); assert_eq!(*b2, 5); *b2 = 42; } assert_eq!(*c.borrow(), (42, 'b')); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1564-1566)1.63.0 · #### pub fn filter\_map<U, F>( orig: RefMut<'b, T>, f: F) -> Result<RefMut<'b, U>, RefMut<'b, T>>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&mut](../primitive.reference) T) -> [Option](../option/enum.option "enum std::option::Option")<[&mut](../primitive.reference) U>, U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Makes a new `RefMut` for an optional component of the borrowed data. The original guard is returned as an `Err(..)` if the closure returns `None`. The `RefCell` is already mutably borrowed, so this cannot fail. This is an associated function that needs to be used as `RefMut::filter_map(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` use std::cell::{RefCell, RefMut}; let c = RefCell::new(vec![1, 2, 3]); { let b1: RefMut<Vec<u32>> = c.borrow_mut(); let mut b2: Result<RefMut<u32>, _> = RefMut::filter_map(b1, |v| v.get_mut(1)); if let Ok(mut b2) = b2 { *b2 += 2; } } assert_eq!(*c.borrow(), vec![1, 4, 3]); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1607-1612)1.35.0 · #### pub fn map\_split<U, V, F>( orig: RefMut<'b, T>, f: F) -> (RefMut<'b, U>, RefMut<'b, V>)where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&mut](../primitive.reference) T) -> ([&mut](../primitive.reference) U, [&mut](../primitive.reference) V), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), V: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Splits a `RefMut` into multiple `RefMut`s for different components of the borrowed data. The underlying `RefCell` will remain mutably borrowed until both returned `RefMut`s go out of scope. The `RefCell` is already mutably borrowed, so this cannot fail. This is an associated function that needs to be used as `RefMut::map_split(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` use std::cell::{RefCell, RefMut}; let cell = RefCell::new([1, 2, 3, 4]); let borrow = cell.borrow_mut(); let (mut begin, mut end) = RefMut::map_split(borrow, |slice| slice.split_at_mut(2)); assert_eq!(*begin, [1, 2]); assert_eq!(*end, [3, 4]); begin.copy_from_slice(&[4, 3]); end.copy_from_slice(&[2, 1]); ``` [source](https://doc.rust-lang.org/src/core/cell.rs.html#1645)#### pub fn leak(orig: RefMut<'b, T>) -> &'b mut T 🔬This is a nightly-only experimental API. (`cell_leak` [#69099](https://github.com/rust-lang/rust/issues/69099)) Convert into a mutable reference to the underlying data. The underlying `RefCell` can not be borrowed from again and will always appear already mutably borrowed, making the returned reference the only to the interior. This is an associated function that needs to be used as `RefMut::leak(...)`. A method would interfere with methods of the same name on the contents of a `RefCell` used through `Deref`. ##### Examples ``` #![feature(cell_leak)] use std::cell::{RefCell, RefMut}; let cell = RefCell::new(0); let value = RefMut::leak(cell.borrow_mut()); assert_eq!(*value, 0); *value = 1; assert!(cell.try_borrow_mut().is_err()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2647)### impl<T> Debug for RefMut<'\_, T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2648)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#1717)### impl<T> Deref for RefMut<'\_, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1721)#### fn deref(&self) -> &T Dereferences the value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1728)### impl<T> DerefMut for RefMut<'\_, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1730)#### fn deref\_mut(&mut self) -> &mut T Mutably dereferences the value. [source](https://doc.rust-lang.org/src/core/cell.rs.html#1740)1.20.0 · ### impl<T> Display for RefMut<'\_, T>where T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1741)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell.rs.html#1737)### impl<'b, T, U> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<'b, T> !RefUnwindSafe for RefMut<'b, T> ### impl<'b, T> !Send for RefMut<'b, T> ### impl<'b, T> !Sync for RefMut<'b, T> ### impl<'b, T: ?Sized> Unpin for RefMut<'b, T> ### impl<'b, T> !UnwindSafe for RefMut<'b, T> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::cell::OnceCell Struct std::cell::OnceCell ========================== ``` pub struct OnceCell<T> { /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) A cell which can be written to only once. Unlike `RefCell`, a `OnceCell` only provides shared `&T` references to its value. Unlike `Cell`, a `OnceCell` doesn’t require copying or replacing the value to access it. Examples -------- ``` #![feature(once_cell)] use std::cell::OnceCell; let cell = OnceCell::new(); assert!(cell.get().is_none()); let value: &String = cell.get_or_init(|| { "Hello, World!".to_string() }); assert_eq!(value, "Hello, World!"); assert!(cell.get().is_some()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#32)### impl<T> OnceCell<T> [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#36)#### pub const fn new() -> OnceCell<T> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Creates a new empty cell. [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#44)#### pub fn get(&self) -> Option<&T> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Gets the reference to the underlying value. Returns `None` if the cell is empty. [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#53)#### pub fn get\_mut(&mut self) -> Option<&mut T> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Gets the mutable reference to the underlying value. Returns `None` if the cell is empty. [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#80)#### pub fn set(&self, value: T) -> Result<(), T> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Sets the contents of the cell to `value`. ##### Errors This method returns `Ok(())` if the cell was empty and `Err(value)` if it was full. ##### Examples ``` #![feature(once_cell)] use std::cell::OnceCell; let cell = OnceCell::new(); assert!(cell.get().is_none()); assert_eq!(cell.set(92), Ok(())); assert_eq!(cell.set(62), Err(62)); assert!(cell.get().is_some()); ``` [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#121-123)#### pub fn get\_or\_init<F>(&self, f: F) -> &Twhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> T, 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Gets the contents of the cell, initializing it with `f` if the cell was empty. ##### Panics If `f` panics, the panic is propagated to the caller, and the cell remains uninitialized. It is an error to reentrantly initialize the cell from `f`. Doing so results in a panic. ##### Examples ``` #![feature(once_cell)] use std::cell::OnceCell; let cell = OnceCell::new(); let value = cell.get_or_init(|| 92); assert_eq!(value, &92); let value = cell.get_or_init(|| unreachable!()); assert_eq!(value, &92); ``` [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#159-161)#### pub fn get\_or\_try\_init<F, E>(&self, f: F) -> Result<&T, E>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> [Result](../result/enum.result "enum std::result::Result")<T, E>, 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Gets the contents of the cell, initializing it with `f` if the cell was empty. If the cell was empty and `f` failed, an error is returned. ##### Panics If `f` panics, the panic is propagated to the caller, and the cell remains uninitialized. It is an error to reentrantly initialize the cell from `f`. Doing so results in a panic. ##### Examples ``` #![feature(once_cell)] use std::cell::OnceCell; let cell = OnceCell::new(); assert_eq!(cell.get_or_try_init(|| Err(())), Err(())); assert!(cell.get().is_none()); let value = cell.get_or_try_init(|| -> Result<i32, ()> { Ok(92) }); assert_eq!(value, Ok(&92)); assert_eq!(cell.get(), Some(&92)) ``` [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#203)#### pub fn into\_inner(self) -> Option<T> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Consumes the cell, returning the wrapped value. Returns `None` if the cell was empty. ##### Examples ``` #![feature(once_cell)] use std::cell::OnceCell; let cell: OnceCell<String> = OnceCell::new(); assert_eq!(cell.into_inner(), None); let cell = OnceCell::new(); cell.set("hello".to_string()).unwrap(); assert_eq!(cell.into_inner(), Some("hello".to_string())); ``` [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#231)#### pub fn take(&mut self) -> Option<T> 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Takes the value out of this `OnceCell`, moving it back to an uninitialized state. Has no effect and returns `None` if the `OnceCell` hasn’t been initialized. Safety is guaranteed by requiring a mutable reference. ##### Examples ``` #![feature(once_cell)] use std::cell::OnceCell; let mut cell: OnceCell<String> = OnceCell::new(); assert_eq!(cell.take(), None); let mut cell = OnceCell::new(); cell.set("hello".to_string()).unwrap(); assert_eq!(cell.take(), Some("hello".to_string())); assert_eq!(cell.get(), None); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#254)### impl<T> Clone for OnceCell<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#255)#### fn clone(&self) -> OnceCell<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#244)### impl<T> Debug for OnceCell<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#245)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#237)### impl<T> Default for OnceCell<T> [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#238)#### fn default() -> OnceCell<T> Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#278)### impl<T> From<T> for OnceCell<T> [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#280)#### const fn from(value: T) -> OnceCell<T> Creates a new `OnceCell<T>` which already contains the given `value`. [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#268)### impl<T> PartialEq<OnceCell<T>> for OnceCell<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#269)#### fn eq(&self, other: &OnceCell<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#275)### impl<T> Eq for OnceCell<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), Auto Trait Implementations -------------------------- ### impl<T> !RefUnwindSafe for OnceCell<T> ### impl<T> Send for OnceCell<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> !Sync for OnceCell<T> ### impl<T> Unpin for OnceCell<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for OnceCell<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::any Module std::any =============== Utilities for dynamic typing or type reflection. `Any` and `TypeId` ------------------- `Any` itself can be used to get a `TypeId`, and has more features when used as a trait object. As `&dyn Any` (a borrowed trait object), it has the `is` and `downcast_ref` methods, to test if the contained value is of a given type, and to get a reference to the inner value as a type. As `&mut dyn Any`, there is also the `downcast_mut` method, for getting a mutable reference to the inner value. `Box<dyn Any>` adds the `downcast` method, which attempts to convert to a `Box<T>`. See the [`Box`](../boxed/struct.box) documentation for the full details. Note that `&dyn Any` is limited to testing whether a value is of a specified concrete type, and cannot be used to test whether a type implements a trait. Smart pointers and `dyn Any` ---------------------------- One piece of behavior to keep in mind when using `Any` as a trait object, especially with types like `Box<dyn Any>` or `Arc<dyn Any>`, is that simply calling `.type_id()` on the value will produce the `TypeId` of the *container*, not the underlying trait object. This can be avoided by converting the smart pointer into a `&dyn Any` instead, which will return the object’s `TypeId`. For example: ``` use std::any::{Any, TypeId}; let boxed: Box<dyn Any> = Box::new(3_i32); // You're more likely to want this: let actual_id = (&*boxed).type_id(); // ... than this: let boxed_id = boxed.type_id(); assert_eq!(actual_id, TypeId::of::<i32>()); assert_eq!(boxed_id, TypeId::of::<Box<dyn Any>>()); ``` ### Examples Consider a situation where we want to log out a value passed to a function. We know the value we’re working on implements Debug, but we don’t know its concrete type. We want to give special treatment to certain types: in this case printing out the length of String values prior to their value. We don’t know the concrete type of our value at compile time, so we need to use runtime reflection instead. ``` use std::fmt::Debug; use std::any::Any; // Logger function for any type that implements Debug. fn log<T: Any + Debug>(value: &T) { let value_any = value as &dyn Any; // Try to convert our value to a `String`. If successful, we want to // output the String`'s length as well as its value. If not, it's a // different type: just print it out unadorned. match value_any.downcast_ref::<String>() { Some(as_string) => { println!("String ({}): {}", as_string.len(), as_string); } None => { println!("{value:?}"); } } } // This function wants to log its parameter out prior to doing work with it. fn do_work<T: Any + Debug>(value: &T) { log(value); // ...do some other work } fn main() { let my_string = "Hello World".to_string(); do_work(&my_string); let my_i8: i8 = 100; do_work(&my_i8); } ``` `Provider` and `Demand` ------------------------ `Provider` and the associated APIs support generic, type-driven access to data, and a mechanism for implementers to provide such data. The key parts of the interface are the `Provider` trait for objects which can provide data, and the [`request_value`](fn.request_value "request_value") and [`request_ref`](fn.request_ref "request_ref") functions for requesting data from an object which implements `Provider`. Generally, end users should not call `request_*` directly, they are helper functions for intermediate implementers to use to implement a user-facing interface. This is purely for the sake of ergonomics, there is no safety concern here; intermediate implementers can typically support methods rather than free functions and use more specific names. Typically, a data provider is a trait object of a trait which extends `Provider`. A user will request data from a trait object by specifying the type of the data. ### Data flow * A user requests an object of a specific type, which is delegated to `request_value` or `request_ref` * `request_*` creates a `Demand` object and passes it to `Provider::provide` * The data provider’s implementation of `Provider::provide` tries providing values of different types using `Demand::provide_*`. If the type matches the type requested by the user, the value will be stored in the `Demand` object. * `request_*` unpacks the `Demand` object and returns any stored value to the user. ### Examples ``` use std::any::{Provider, Demand, request_ref}; // Definition of MyTrait, a data provider. trait MyTrait: Provider { // ... } // Methods on `MyTrait` trait objects. impl dyn MyTrait + '_ { /// Get a reference to a field of the implementing struct. pub fn get_context_by_ref<T: ?Sized + 'static>(&self) -> Option<&T> { request_ref::<T>(self) } } // Downstream implementation of `MyTrait` and `Provider`. impl MyTrait for SomeConcreteType { // ... } impl Provider for SomeConcreteType { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { // Provide a string reference. We could provide multiple values with // different types here. demand.provide_ref::<String>(&self.some_string); } } // Downstream usage of `MyTrait`. fn use_my_trait(obj: &dyn MyTrait) { // Request a &String from obj. let _ = obj.get_context_by_ref::<String>().unwrap(); } ``` In this example, if the concrete type of `obj` in `use_my_trait` is `SomeConcreteType`, then the `get_context_ref` call will return a reference to `obj.some_string` with type `&String`. Structs ------- [Demand](struct.demand "std::any::Demand struct")Experimental A helper object for providing data by type. [TypeId](struct.typeid "std::any::TypeId struct") A `TypeId` represents a globally unique identifier for a type. Traits ------ [Provider](trait.provider "std::any::Provider trait")Experimental Trait implemented by a type which can dynamically provide values based on type. [Any](trait.any "std::any::Any trait") A trait to emulate dynamic typing. Functions --------- [request\_ref](fn.request_ref "std::any::request_ref fn")Experimental Request a reference from the `Provider`. [request\_value](fn.request_value "std::any::request_value fn")Experimental Request a value from the `Provider`. [type\_name\_of\_val](fn.type_name_of_val "std::any::type_name_of_val fn")Experimental Returns the name of the type of the pointed-to value as a string slice. This is the same as `type_name::<T>()`, but can be used where the type of a variable is not easily available. [type\_name](fn.type_name "std::any::type_name fn") Returns the name of a type as a string slice. rust Function std::any::type_name_of_val Function std::any::type\_name\_of\_val ====================================== ``` pub fn type_name_of_val<T>(_val: &T) -> &'static strwhere    T: ?Sized, ``` 🔬This is a nightly-only experimental API. (`type_name_of_val` [#66359](https://github.com/rust-lang/rust/issues/66359)) Returns the name of the type of the pointed-to value as a string slice. This is the same as `type_name::<T>()`, but can be used where the type of a variable is not easily available. Note ---- This is intended for diagnostic use. The exact contents and format of the string are not specified, other than being a best-effort description of the type. For example, `type_name_of_val::<Option<String>>(None)` could return `"Option<String>"` or `"std::option::Option<std::string::String>"`, but not `"foobar"`. In addition, the output may change between versions of the compiler. This function does not resolve trait objects, meaning that `type_name_of_val(&7u32 as &dyn Debug)` may return `"dyn Debug"`, but not `"u32"`. The type name should not be considered a unique identifier of a type; multiple types may share the same type name. The current implementation uses the same infrastructure as compiler diagnostics and debuginfo, but this is not guaranteed. Examples -------- Prints the default integer and float types. ``` #![feature(type_name_of_val)] use std::any::type_name_of_val; let x = 1; println!("{}", type_name_of_val(&x)); let y = 1.0; println!("{}", type_name_of_val(&y)); ```
programming_docs
rust Function std::any::request_value Function std::any::request\_value ================================= ``` pub fn request_value<T>(provider: &'a impl Provider) -> Option<T>where    T: 'static, ``` 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Request a value from the `Provider`. Examples -------- Get a string value from a provider. ``` use std::any::{Provider, request_value}; fn get_string(provider: &impl Provider) -> String { request_value::<String>(provider).unwrap() } ``` rust Trait std::any::Any Trait std::any::Any =================== ``` pub trait Any: 'static { fn type_id(&self) -> TypeId; } ``` A trait to emulate dynamic typing. Most types implement `Any`. However, any type which contains a non-`'static` reference does not. See the [module-level documentation](index) for more details. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#196)1.34.0 · #### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. ##### Examples ``` use std::any::{Any, TypeId}; fn is_string(s: &dyn Any) -> bool { TypeId::of::<String>() == s.type_id() } assert_eq!(is_string(&0), false); assert_eq!(is_string(&"cookie monster".to_string()), true); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1647)### impl<A> Box<dyn Any + 'static, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1667)#### pub fn downcast<T>(self) -> Result<Box<T, A>, Box<dyn Any + 'static, A>>where T: [Any](trait.any "trait std::any::Any"), Attempt to downcast the box to a concrete type. ##### Examples ``` use std::any::Any; fn print_if_string(value: Box<dyn Any>) { if let Ok(string) = value.downcast::<String>() { println!("String ({}): {}", string.len(), string); } } let my_string = "Hello World".to_string(); print_if_string(Box::new(my_string)); print_if_string(Box::new(0i8)); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1697)#### pub unsafe fn downcast\_unchecked<T>(self) -> Box<T, A>where T: [Any](trait.any "trait std::any::Any"), Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Downcasts the box to a concrete type. For a safe alternative see [`downcast`](../boxed/struct.box#method.downcast). ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1706)### impl<A> Box<dyn Any + Send + 'static, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1726)#### pub fn downcast<T>(self) -> Result<Box<T, A>, Box<dyn Any + Send + 'static, A>>where T: [Any](trait.any "trait std::any::Any"), Attempt to downcast the box to a concrete type. ##### Examples ``` use std::any::Any; fn print_if_string(value: Box<dyn Any + Send>) { if let Ok(string) = value.downcast::<String>() { println!("String ({}): {}", string.len(), string); } } let my_string = "Hello World".to_string(); print_if_string(Box::new(my_string)); print_if_string(Box::new(0i8)); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1756)#### pub unsafe fn downcast\_unchecked<T>(self) -> Box<T, A>where T: [Any](trait.any "trait std::any::Any"), Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Downcasts the box to a concrete type. For a safe alternative see [`downcast`](../boxed/struct.box#method.downcast). ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any + Send> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1765)### impl<A> Box<dyn Any + Send + Sync + 'static, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1785)1.51.0 · #### pub fn downcast<T>( self) -> Result<Box<T, A>, Box<dyn Any + Send + Sync + 'static, A>>where T: [Any](trait.any "trait std::any::Any"), Attempt to downcast the box to a concrete type. ##### Examples ``` use std::any::Any; fn print_if_string(value: Box<dyn Any + Send + Sync>) { if let Ok(string) = value.downcast::<String>() { println!("String ({}): {}", string.len(), string); } } let my_string = "Hello World".to_string(); print_if_string(Box::new(my_string)); print_if_string(Box::new(0i8)); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1815)#### pub unsafe fn downcast\_unchecked<T>(self) -> Box<T, A>where T: [Any](trait.any "trait std::any::Any"), Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Downcasts the box to a concrete type. For a safe alternative see [`downcast`](../boxed/struct.box#method.downcast). ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any + Send + Sync> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/core/any.rs.html#234)### impl dyn Any + 'static [source](https://doc.rust-lang.org/src/core/any.rs.html#255)#### pub fn is<T>(&self) -> boolwhere T: [Any](trait.any "trait std::any::Any"), Returns `true` if the inner type is the same as `T`. ##### Examples ``` use std::any::Any; fn is_string(s: &dyn Any) { if s.is::<String>() { println!("It's a string!"); } else { println!("Not a string..."); } } is_string(&0); is_string(&"cookie monster".to_string()); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#287)#### pub fn downcast\_ref<T>(&self) -> Option<&T>where T: [Any](trait.any "trait std::any::Any"), Returns some reference to the inner value if it is of type `T`, or `None` if it isn’t. ##### Examples ``` use std::any::Any; fn print_if_string(s: &dyn Any) { if let Some(string) = s.downcast_ref::<String>() { println!("It's a string({}): '{}'", string.len(), string); } else { println!("Not a string..."); } } print_if_string(&0); print_if_string(&"cookie monster".to_string()); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#323)#### pub fn downcast\_mut<T>(&mut self) -> Option<&mut T>where T: [Any](trait.any "trait std::any::Any"), Returns some mutable reference to the inner value if it is of type `T`, or `None` if it isn’t. ##### Examples ``` use std::any::Any; fn modify_if_u32(s: &mut dyn Any) { if let Some(num) = s.downcast_mut::<u32>() { *num = 42; } } let mut x = 10u32; let mut s = "starlord".to_string(); modify_if_u32(&mut x); modify_if_u32(&mut s); assert_eq!(x, 42); assert_eq!(&s, "starlord"); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#356)#### pub unsafe fn downcast\_ref\_unchecked<T>(&self) -> &Twhere T: [Any](trait.any "trait std::any::Any"), 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Returns a reference to the inner value as type `dyn T`. ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_ref_unchecked::<usize>(), 1); } ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/core/any.rs.html#386)#### pub unsafe fn downcast\_mut\_unchecked<T>(&mut self) -> &mut Twhere T: [Any](trait.any "trait std::any::Any"), 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Returns a mutable reference to the inner value as type `dyn T`. ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let mut x: Box<dyn Any> = Box::new(1_usize); unsafe { *x.downcast_mut_unchecked::<usize>() += 1; } assert_eq!(*x.downcast_ref::<usize>().unwrap(), 2); ``` ##### Safety The contained value must be of type `T`. Calling this method with the incorrect type is *undefined behavior*. [source](https://doc.rust-lang.org/src/core/any.rs.html#393)### impl dyn Any + Send + 'static [source](https://doc.rust-lang.org/src/core/any.rs.html#414)#### pub fn is<T>(&self) -> boolwhere T: [Any](trait.any "trait std::any::Any"), Forwards to the method defined on the type `dyn Any`. ##### Examples ``` use std::any::Any; fn is_string(s: &(dyn Any + Send)) { if s.is::<String>() { println!("It's a string!"); } else { println!("Not a string..."); } } is_string(&0); is_string(&"cookie monster".to_string()); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#438)#### pub fn downcast\_ref<T>(&self) -> Option<&T>where T: [Any](trait.any "trait std::any::Any"), Forwards to the method defined on the type `dyn Any`. ##### Examples ``` use std::any::Any; fn print_if_string(s: &(dyn Any + Send)) { if let Some(string) = s.downcast_ref::<String>() { println!("It's a string({}): '{}'", string.len(), string); } else { println!("Not a string..."); } } print_if_string(&0); print_if_string(&"cookie monster".to_string()); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#466)#### pub fn downcast\_mut<T>(&mut self) -> Option<&mut T>where T: [Any](trait.any "trait std::any::Any"), Forwards to the method defined on the type `dyn Any`. ##### Examples ``` use std::any::Any; fn modify_if_u32(s: &mut (dyn Any + Send)) { if let Some(num) = s.downcast_mut::<u32>() { *num = 42; } } let mut x = 10u32; let mut s = "starlord".to_string(); modify_if_u32(&mut x); modify_if_u32(&mut s); assert_eq!(x, 42); assert_eq!(&s, "starlord"); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#491)#### pub unsafe fn downcast\_ref\_unchecked<T>(&self) -> &Twhere T: [Any](trait.any "trait std::any::Any"), 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Forwards to the method defined on the type `dyn Any`. ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_ref_unchecked::<usize>(), 1); } ``` ##### Safety Same as the method on the type `dyn Any`. [source](https://doc.rust-lang.org/src/core/any.rs.html#519)#### pub unsafe fn downcast\_mut\_unchecked<T>(&mut self) -> &mut Twhere T: [Any](trait.any "trait std::any::Any"), 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Forwards to the method defined on the type `dyn Any`. ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let mut x: Box<dyn Any> = Box::new(1_usize); unsafe { *x.downcast_mut_unchecked::<usize>() += 1; } assert_eq!(*x.downcast_ref::<usize>().unwrap(), 2); ``` ##### Safety Same as the method on the type `dyn Any`. [source](https://doc.rust-lang.org/src/core/any.rs.html#525)### impl dyn Any + Send + Sync + 'static [source](https://doc.rust-lang.org/src/core/any.rs.html#546)1.28.0 · #### pub fn is<T>(&self) -> boolwhere T: [Any](trait.any "trait std::any::Any"), Forwards to the method defined on the type `Any`. ##### Examples ``` use std::any::Any; fn is_string(s: &(dyn Any + Send + Sync)) { if s.is::<String>() { println!("It's a string!"); } else { println!("Not a string..."); } } is_string(&0); is_string(&"cookie monster".to_string()); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#570)1.28.0 · #### pub fn downcast\_ref<T>(&self) -> Option<&T>where T: [Any](trait.any "trait std::any::Any"), Forwards to the method defined on the type `Any`. ##### Examples ``` use std::any::Any; fn print_if_string(s: &(dyn Any + Send + Sync)) { if let Some(string) = s.downcast_ref::<String>() { println!("It's a string({}): '{}'", string.len(), string); } else { println!("Not a string..."); } } print_if_string(&0); print_if_string(&"cookie monster".to_string()); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#598)1.28.0 · #### pub fn downcast\_mut<T>(&mut self) -> Option<&mut T>where T: [Any](trait.any "trait std::any::Any"), Forwards to the method defined on the type `Any`. ##### Examples ``` use std::any::Any; fn modify_if_u32(s: &mut (dyn Any + Send + Sync)) { if let Some(num) = s.downcast_mut::<u32>() { *num = 42; } } let mut x = 10u32; let mut s = "starlord".to_string(); modify_if_u32(&mut x); modify_if_u32(&mut s); assert_eq!(x, 42); assert_eq!(&s, "starlord"); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#619)#### pub unsafe fn downcast\_ref\_unchecked<T>(&self) -> &Twhere T: [Any](trait.any "trait std::any::Any"), 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Forwards to the method defined on the type `Any`. ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let x: Box<dyn Any> = Box::new(1_usize); unsafe { assert_eq!(*x.downcast_ref_unchecked::<usize>(), 1); } ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#643)#### pub unsafe fn downcast\_mut\_unchecked<T>(&mut self) -> &mut Twhere T: [Any](trait.any "trait std::any::Any"), 🔬This is a nightly-only experimental API. (`downcast_unchecked` [#90850](https://github.com/rust-lang/rust/issues/90850)) Forwards to the method defined on the type `Any`. ##### Examples ``` #![feature(downcast_unchecked)] use std::any::Any; let mut x: Box<dyn Any> = Box::new(1_usize); unsafe { *x.downcast_mut_unchecked::<usize>() += 1; } assert_eq!(*x.downcast_ref::<usize>().unwrap(), 2); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#211)### impl Debug for dyn Any + 'static [source](https://doc.rust-lang.org/src/core/any.rs.html#212)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/any.rs.html#221)### impl Debug for dyn Any + Send + 'static [source](https://doc.rust-lang.org/src/core/any.rs.html#222)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/any.rs.html#228)1.28.0 · ### impl Debug for dyn Any + Send + Sync + 'static [source](https://doc.rust-lang.org/src/core/any.rs.html#229)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) Implementors ------------ [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), rust Struct std::any::TypeId Struct std::any::TypeId ======================= ``` pub struct TypeId { /* private fields */ } ``` A `TypeId` represents a globally unique identifier for a type. Each `TypeId` is an opaque object which does not allow inspection of what’s inside but does allow basic operations such as cloning, comparison, printing, and showing. A `TypeId` is currently only available for types which ascribe to `'static`, but this limitation may be removed in the future. While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth noting that the hashes and ordering will vary between Rust releases. Beware of relying on them inside of your code! Implementations --------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#671)### impl TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#690)const: [unstable](https://github.com/rust-lang/rust/issues/77125 "Tracking issue for const_type_id") · #### pub fn of<T>() -> TypeIdwhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns the `TypeId` of the type this generic function has been instantiated with. ##### Examples ``` use std::any::{Any, TypeId}; fn is_string<T: ?Sized + Any>(_s: &T) -> bool { TypeId::of::<String>() == TypeId::of::<T>() } assert_eq!(is_string(&0), false); assert_eq!(is_string(&"cookie monster".to_string()), true); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Clone for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)#### fn clone(&self) -> TypeId Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Debug for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Hash for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Ord for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)#### fn cmp(&self, other: &TypeId) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl PartialEq<TypeId> for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)#### fn eq(&self, other: &TypeId) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl PartialOrd<TypeId> for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)#### fn partial\_cmp(&self, other: &TypeId) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Copy for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Eq for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl StructuralEq for TypeId [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl StructuralPartialEq for TypeId Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for TypeId ### impl Send for TypeId ### impl Sync for TypeId ### impl Unpin for TypeId ### impl UnwindSafe for TypeId Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Trait std::any::Provider Trait std::any::Provider ======================== ``` pub trait Provider { fn provide(&'a self, demand: &mut Demand<'a>); } ``` 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Trait implemented by a type which can dynamically provide values based on type. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#804)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. Note that the `provide_*` methods on `Demand` have short-circuit semantics: if an earlier method has successfully provided a value, then later methods will not get an opportunity to provide. ##### Examples Provides a reference to a field with type `String` as a `&str`, and a value of type `i32`. ``` use std::any::{Provider, Demand}; impl Provider for SomeConcreteType { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { demand.provide_ref::<str>(&self.field) .provide_value::<i32>(self.num_field); } } ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), rust Function std::any::request_ref Function std::any::request\_ref =============================== ``` pub fn request_ref<T>(provider: &'a impl Provider) -> Option<&'a T>where    T: 'static + ?Sized, ``` 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Request a reference from the `Provider`. Examples -------- Get a string reference from a provider. ``` use std::any::{Provider, request_ref}; fn get_str(provider: &impl Provider) -> &str { request_ref::<str>(provider).unwrap() } ``` rust Struct std::any::Demand Struct std::any::Demand ======================= ``` #[repr(transparent)]pub struct Demand<'a>(_); ``` 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) A helper object for providing data by type. A data provider provides values by calling this type’s provide methods. Implementations --------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#872)### impl<'a> Demand<'a> [source](https://doc.rust-lang.org/src/core/any.rs.html#899-901)#### pub fn provide\_value<T>(&mut self, value: T) -> &mut Demand<'a>where T: 'static, 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Provide a value or other type with only static lifetimes. ##### Examples Provides an `u8`. ``` #![feature(provide_any)] use std::any::{Provider, Demand}; impl Provider for SomeConcreteType { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { demand.provide_value::<u8>(self.field); } } ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#925-927)#### pub fn provide\_value\_with<T>( &mut self, fulfil: impl FnOnce() -> T) -> &mut Demand<'a>where T: 'static, 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Provide a value or other type with only static lifetimes computed using a closure. ##### Examples Provides a `String` by cloning. ``` #![feature(provide_any)] use std::any::{Provider, Demand}; impl Provider for SomeConcreteType { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { demand.provide_value_with::<String>(|| self.field.clone()); } } ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#952)#### pub fn provide\_ref<T>(&mut self, value: &'a T) -> &mut Demand<'a>where T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Provide a reference. The referee type must be bounded by `'static`, but may be unsized. ##### Examples Provides a reference to a field as a `&str`. ``` #![feature(provide_any)] use std::any::{Provider, Demand}; impl Provider for SomeConcreteType { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { demand.provide_ref::<str>(&self.field); } } ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#983-986)#### pub fn provide\_ref\_with<T>( &mut self, fulfil: impl FnOnce() -> &'a T) -> &mut Demand<'a>where T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Provide a reference computed using a closure. The referee type must be bounded by `'static`, but may be unsized. ##### Examples Provides a reference to a field as a `&str`. ``` #![feature(provide_any)] use std::any::{Provider, Demand}; impl Provider for SomeConcreteType { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { demand.provide_ref_with::<str>(|| { if today_is_a_weekday() { &self.business } else { &self.party } }); } } ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#1076-1078)#### pub fn would\_be\_satisfied\_by\_value\_of<T>(&self) -> boolwhere T: 'static, 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Check if the `Demand` would be satisfied if provided with a value of the specified type. If the type does not match or has already been provided, returns false. ##### Examples Check if an `u8` still needs to be provided and then provides it. ``` #![feature(provide_any)] use std::any::{Provider, Demand}; struct Parent(Option<u8>); impl Provider for Parent { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { if let Some(v) = self.0 { demand.provide_value::<u8>(v); } } } struct Child { parent: Parent, } impl Child { // Pretend that this takes a lot of resources to evaluate. fn an_expensive_computation(&self) -> Option<u8> { Some(99) } } impl Provider for Child { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { // In general, we don't know if this call will provide // an `u8` value or not... self.parent.provide(demand); // ...so we check to see if the `u8` is needed before // we run our expensive computation. if demand.would_be_satisfied_by_value_of::<u8>() { if let Some(v) = self.an_expensive_computation() { demand.provide_value::<u8>(v); } } // The demand will be satisfied now, regardless of if // the parent provided the value or we did. assert!(!demand.would_be_satisfied_by_value_of::<u8>()); } } let parent = Parent(Some(42)); let child = Child { parent }; assert_eq!(Some(42), std::any::request_value::<u8>(&child)); let parent = Parent(None); let child = Child { parent }; assert_eq!(Some(99), std::any::request_value::<u8>(&child)); ``` [source](https://doc.rust-lang.org/src/core/any.rs.html#1148-1150)#### pub fn would\_be\_satisfied\_by\_ref\_of<T>(&self) -> boolwhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Check if the `Demand` would be satisfied if provided with a reference to a value of the specified type. If the type does not match or has already been provided, returns false. ##### Examples Check if a `&str` still needs to be provided and then provides it. ``` #![feature(provide_any)] use std::any::{Provider, Demand}; struct Parent(Option<String>); impl Provider for Parent { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { if let Some(v) = &self.0 { demand.provide_ref::<str>(v); } } } struct Child { parent: Parent, name: String, } impl Child { // Pretend that this takes a lot of resources to evaluate. fn an_expensive_computation(&self) -> Option<&str> { Some(&self.name) } } impl Provider for Child { fn provide<'a>(&'a self, demand: &mut Demand<'a>) { // In general, we don't know if this call will provide // a `str` reference or not... self.parent.provide(demand); // ...so we check to see if the `&str` is needed before // we run our expensive computation. if demand.would_be_satisfied_by_ref_of::<str>() { if let Some(v) = self.an_expensive_computation() { demand.provide_ref::<str>(v); } } // The demand will be satisfied now, regardless of if // the parent provided the reference or we did. assert!(!demand.would_be_satisfied_by_ref_of::<str>()); } } let parent = Parent(Some("parent".into())); let child = Child { parent, name: "child".into() }; assert_eq!(Some("parent"), std::any::request_ref::<str>(&child)); let parent = Parent(None); let child = Child { parent, name: "child".into() }; assert_eq!(Some("child"), std::any::request_ref::<str>(&child)); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#1164)### impl<'a> Debug for Demand<'a> [source](https://doc.rust-lang.org/src/core/any.rs.html#1165)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) Auto Trait Implementations -------------------------- ### impl<'a> !RefUnwindSafe for Demand<'a> ### impl<'a> !Send for Demand<'a> ### impl<'a> !Sized for Demand<'a> ### impl<'a> !Sync for Demand<'a> ### impl<'a> !Unpin for Demand<'a> ### impl<'a> !UnwindSafe for Demand<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) rust Function std::any::type_name Function std::any::type\_name ============================= ``` pub fn type_name<T>() -> &'static strwhere    T: ?Sized, ``` Returns the name of a type as a string slice. Note ---- This is intended for diagnostic use. The exact contents and format of the string returned are not specified, other than being a best-effort description of the type. For example, amongst the strings that `type_name::<Option<String>>()` might return are `"Option<String>"` and `"std::option::Option<std::string::String>"`. The returned string must not be considered to be a unique identifier of a type as multiple types may map to the same type name. Similarly, there is no guarantee that all parts of a type will appear in the returned string: for example, lifetime specifiers are currently not included. In addition, the output may change between versions of the compiler. The current implementation uses the same infrastructure as compiler diagnostics and debuginfo, but this is not guaranteed. Examples -------- ``` assert_eq!( std::any::type_name::<Option<String>>(), "core::option::Option<alloc::string::String>", ); ``` rust Struct std::vec::Vec Struct std::vec::Vec ==================== ``` pub struct Vec<T, A = Global>where    A: Allocator,{ /* private fields */ } ``` A contiguous growable array type, written as `Vec<T>`, short for ‘vector’. Examples -------- ``` let mut vec = Vec::new(); vec.push(1); vec.push(2); assert_eq!(vec.len(), 2); assert_eq!(vec[0], 1); assert_eq!(vec.pop(), Some(2)); assert_eq!(vec.len(), 1); vec[0] = 7; assert_eq!(vec[0], 7); vec.extend([1, 2, 3].iter().copied()); for x in &vec { println!("{x}"); } assert_eq!(vec, [7, 1, 2, 3]); ``` The [`vec!`](../macro.vec "vec!") macro is provided for convenient initialization: ``` let mut vec1 = vec![1, 2, 3]; vec1.push(4); let vec2 = Vec::from([1, 2, 3, 4]); assert_eq!(vec1, vec2); ``` It can also initialize each element of a `Vec<T>` with a given value. This may be more efficient than performing allocation and initialization in separate steps, especially when initializing a vector of zeros: ``` let vec = vec![0; 5]; assert_eq!(vec, [0, 0, 0, 0, 0]); // The following is equivalent, but potentially slower: let mut vec = Vec::with_capacity(5); vec.resize(5, 0); assert_eq!(vec, [0, 0, 0, 0, 0]); ``` For more information, see [Capacity and Reallocation](#capacity-and-reallocation). Use a `Vec<T>` as an efficient stack: ``` let mut stack = Vec::new(); stack.push(1); stack.push(2); stack.push(3); while let Some(top) = stack.pop() { // Prints 3, 2, 1 println!("{top}"); } ``` Indexing -------- The `Vec` type allows to access values by index, because it implements the [`Index`](../ops/trait.index "Index") trait. An example will be more explicit: ``` let v = vec![0, 2, 4, 6]; println!("{}", v[1]); // it will display '2' ``` However be careful: if you try to access an index which isn’t in the `Vec`, your software will panic! You cannot do this: ⓘ ``` let v = vec![0, 2, 4, 6]; println!("{}", v[6]); // it will panic! ``` Use [`get`](struct.vec#method.get) and [`get_mut`](struct.vec#method.get_mut) if you want to check whether the index is in the `Vec`. Slicing ------- A `Vec` can be mutable. On the other hand, slices are read-only objects. To get a [slice](../primitive.slice "slice"), use [`&`](../primitive.reference "&"). Example: ``` fn read_slice(slice: &[usize]) { // ... } let v = vec![0, 1]; read_slice(&v); // ... and that's all! // you can also do it like this: let u: &[usize] = &v; // or like this: let u: &[_] = &v; ``` In Rust, it’s more common to pass slices as arguments rather than vectors when you just want to provide read access. The same goes for [`String`](../string/struct.string) and [`&str`](../primitive.str). Capacity and reallocation ------------------------- The capacity of a vector is the amount of space allocated for any future elements that will be added onto the vector. This is not to be confused with the *length* of a vector, which specifies the number of actual elements within the vector. If a vector’s length exceeds its capacity, its capacity will automatically be increased, but its elements will have to be reallocated. For example, a vector with capacity 10 and length 0 would be an empty vector with space for 10 more elements. Pushing 10 or fewer elements onto the vector will not change its capacity or cause reallocation to occur. However, if the vector’s length is increased to 11, it will have to reallocate, which can be slow. For this reason, it is recommended to use [`Vec::with_capacity`](struct.vec#method.with_capacity "Vec::with_capacity") whenever possible to specify how big the vector is expected to get. Guarantees ---------- Due to its incredibly fundamental nature, `Vec` makes a lot of guarantees about its design. This ensures that it’s as low-overhead as possible in the general case, and can be correctly manipulated in primitive ways by unsafe code. Note that these guarantees refer to an unqualified `Vec<T>`. If additional type parameters are added (e.g., to support custom allocators), overriding their defaults may change the behavior. Most fundamentally, `Vec` is and always will be a (pointer, capacity, length) triplet. No more, no less. The order of these fields is completely unspecified, and you should use the appropriate methods to modify these. The pointer will never be null, so this type is null-pointer-optimized. However, the pointer might not actually point to allocated memory. In particular, if you construct a `Vec` with capacity 0 via [`Vec::new`](struct.vec#method.new "Vec::new"), [`vec![]`](../macro.vec "vec!"), [`Vec::with_capacity(0)`](struct.vec#method.with_capacity "Vec::with_capacity"), or by calling [`shrink_to_fit`](struct.vec#method.shrink_to_fit) on an empty Vec, it will not allocate memory. Similarly, if you store zero-sized types inside a `Vec`, it will not allocate space for them. *Note that in this case the `Vec` might not report a [`capacity`](struct.vec#method.capacity) of 0*. `Vec` will allocate if and only if `[mem::size\_of::<T>](../mem/fn.size_of)() * [capacity](struct.vec#method.capacity)() > 0`. In general, `Vec`’s allocation details are very subtle — if you intend to allocate memory using a `Vec` and use it for something else (either to pass to unsafe code, or to build your own memory-backed collection), be sure to deallocate this memory by using `from_raw_parts` to recover the `Vec` and then dropping it. If a `Vec` *has* allocated memory, then the memory it points to is on the heap (as defined by the allocator Rust is configured to use by default), and its pointer points to [`len`](struct.vec#method.len) initialized, contiguous elements in order (what you would see if you coerced it to a slice), followed by `[capacity](struct.vec#method.capacity) - [len](struct.vec#method.len)` logically uninitialized, contiguous elements. A vector containing the elements `'a'` and `'b'` with capacity 4 can be visualized as below. The top part is the `Vec` struct, it contains a pointer to the head of the allocation in the heap, length and capacity. The bottom part is the allocation on the heap, a contiguous memory block. ``` ptr len capacity +--------+--------+--------+ | 0x0123 | 2 | 4 | +--------+--------+--------+ | v Heap +--------+--------+--------+--------+ | 'a' | 'b' | uninit | uninit | +--------+--------+--------+--------+ ``` * **uninit** represents memory that is not initialized, see [`MaybeUninit`](../mem/union.maybeuninit). * Note: the ABI is not stable and `Vec` makes no guarantees about its memory layout (including the order of fields). `Vec` will never perform a “small optimization” where elements are actually stored on the stack for two reasons: * It would make it more difficult for unsafe code to correctly manipulate a `Vec`. The contents of a `Vec` wouldn’t have a stable address if it were only moved, and it would be more difficult to determine if a `Vec` had actually allocated memory. * It would penalize the general case, incurring an additional branch on every access. `Vec` will never automatically shrink itself, even if completely empty. This ensures no unnecessary allocations or deallocations occur. Emptying a `Vec` and then filling it back up to the same [`len`](struct.vec#method.len) should incur no calls to the allocator. If you wish to free up unused memory, use [`shrink_to_fit`](struct.vec#method.shrink_to_fit) or [`shrink_to`](struct.vec#method.shrink_to). [`push`](struct.vec#method.push) and [`insert`](struct.vec#method.insert) will never (re)allocate if the reported capacity is sufficient. [`push`](struct.vec#method.push) and [`insert`](struct.vec#method.insert) *will* (re)allocate if `[len](struct.vec#method.len) == [capacity](struct.vec#method.capacity)`. That is, the reported capacity is completely accurate, and can be relied on. It can even be used to manually free the memory allocated by a `Vec` if desired. Bulk insertion methods *may* reallocate, even when not necessary. `Vec` does not guarantee any particular growth strategy when reallocating when full, nor when [`reserve`](struct.vec#method.reserve) is called. The current strategy is basic and it may prove desirable to use a non-constant growth factor. Whatever strategy is used will of course guarantee *O*(1) amortized [`push`](struct.vec#method.push). `vec![x; n]`, `vec![a, b, c, d]`, and [`Vec::with_capacity(n)`](struct.vec#method.with_capacity "Vec::with_capacity"), will all produce a `Vec` with exactly the requested capacity. If `[len](struct.vec#method.len) == [capacity](struct.vec#method.capacity)`, (as is the case for the [`vec!`](../macro.vec "vec!") macro), then a `Vec<T>` can be converted to and from a [`Box<[T]>`](../boxed/struct.box) without reallocating or moving the elements. `Vec` will not specifically overwrite any data that is removed from it, but also won’t specifically preserve it. Its uninitialized memory is scratch space that it may use however it wants. It will generally just do whatever is most efficient or otherwise easy to implement. Do not rely on removed data to be erased for security purposes. Even if you drop a `Vec`, its buffer may simply be reused by another allocation. Even if you zero a `Vec`’s memory first, that might not actually happen because the optimizer does not consider this a side-effect that must be preserved. There is one case which we will not break, however: using `unsafe` code to write to the excess capacity, and then increasing the length to match, is always valid. Currently, `Vec` does not guarantee the order in which elements are dropped. The order has changed in the past and may change again. Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#409)### impl<T> Vec<T, Global> [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#424)const: 1.39.0 · #### pub const fn new() -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Constructs a new, empty `Vec<T>`. The vector will not allocate until elements are pushed onto it. ##### Examples ``` let mut vec: Vec<i32> = Vec::new(); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#482)#### pub fn with\_capacity(capacity: usize) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Constructs a new, empty `Vec<T>` with at least the specified capacity. The vector will be able to hold at least `capacity` elements without reallocating. This method is allowed to allocate for more elements than `capacity`. If `capacity` is 0, the vector will not allocate. It is important to note that although the returned vector has the minimum *capacity* specified, the vector will have a zero *length*. For an explanation of the difference between length and capacity, see *[Capacity and reallocation](#capacity-and-reallocation)*. If it is important to know the exact allocated capacity of a `Vec`, always use the [`capacity`](struct.vec#method.capacity) method after construction. For `Vec<T>` where `T` is a zero-sized type, there will be no allocation and the capacity will always be `usize::MAX`. ##### Panics Panics if the new capacity exceeds `isize::MAX` bytes. ##### Examples ``` let mut vec = Vec::with_capacity(10); // The vector contains no items, even though it has capacity for more assert_eq!(vec.len(), 0); assert!(vec.capacity() >= 10); // These are all done without reallocating... for i in 0..10 { vec.push(i); } assert_eq!(vec.len(), 10); assert!(vec.capacity() >= 10); // ...but this may make the vector reallocate vec.push(11); assert_eq!(vec.len(), 11); assert!(vec.capacity() >= 11); // A vector of a zero-sized type will always over-allocate, since no // allocation is necessary let vec_units = Vec::<()>::with_capacity(10); assert_eq!(vec_units.capacity(), usize::MAX); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#556)#### pub unsafe fn from\_raw\_parts( ptr: \*mut T, length: usize, capacity: usize) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Creates a `Vec<T>` directly from the raw components of another vector. ##### Safety This is highly unsafe, due to the number of invariants that aren’t checked: * `ptr` needs to have been previously allocated via [`String`](../string/struct.string)/`Vec<T>` (at least, it’s highly likely to be incorrect if it wasn’t). * `T` needs to have the same alignment as what `ptr` was allocated with. (`T` having a less strict alignment is not sufficient, the alignment really needs to be equal to satisfy the [`dealloc`](../alloc/trait.globalalloc#tymethod.dealloc) requirement that memory must be allocated and deallocated with the same layout.) * The size of `T` times the `capacity` (ie. the allocated size in bytes) needs to be the same size as the pointer was allocated with. (Because similar to alignment, [`dealloc`](../alloc/trait.globalalloc#tymethod.dealloc) must be called with the same layout `size`.) * `length` needs to be less than or equal to `capacity`. Violating these may cause problems like corrupting the allocator’s internal data structures. For example it is normally **not** safe to build a `Vec<u8>` from a pointer to a C `char` array with length `size_t`, doing so is only safe if the array was initially allocated by a `Vec` or `String`. It’s also not safe to build one from a `Vec<u16>` and its length, because the allocator cares about the alignment, and these two types have different alignments. The buffer was allocated with alignment 2 (for `u16`), but after turning it into a `Vec<u8>` it’ll be deallocated with alignment 1. To avoid these issues, it is often preferable to do casting/transmuting using [`slice::from_raw_parts`](../slice/fn.from_raw_parts "slice::from_raw_parts") instead. The ownership of `ptr` is effectively transferred to the `Vec<T>` which may then deallocate, reallocate or change the contents of memory pointed to by the pointer at will. Ensure that nothing else uses the pointer after calling this function. ##### Examples ``` use std::ptr; use std::mem; let v = vec![1, 2, 3]; // Prevent running `v`'s destructor so we are in complete control // of the allocation. let mut v = mem::ManuallyDrop::new(v); // Pull out the various important pieces of information about `v` let p = v.as_mut_ptr(); let len = v.len(); let cap = v.capacity(); unsafe { // Overwrite memory with 4, 5, 6 for i in 0..len { ptr::write(p.add(i), 4 + i); } // Put everything back together into a Vec let rebuilt = Vec::from_raw_parts(p, len, cap); assert_eq!(rebuilt, [4, 5, 6]); } ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#561)### impl<T, A> Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#578)#### pub const fn new\_in(alloc: A) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new, empty `Vec<T, A>`. The vector will not allocate until elements are pushed onto it. ##### Examples ``` #![feature(allocator_api)] use std::alloc::System; let mut vec: Vec<i32, _> = Vec::new_in(System); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#640)#### pub fn with\_capacity\_in(capacity: usize, alloc: A) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Constructs a new, empty `Vec<T, A>` with at least the specified capacity with the provided allocator. The vector will be able to hold at least `capacity` elements without reallocating. This method is allowed to allocate for more elements than `capacity`. If `capacity` is 0, the vector will not allocate. It is important to note that although the returned vector has the minimum *capacity* specified, the vector will have a zero *length*. For an explanation of the difference between length and capacity, see *[Capacity and reallocation](#capacity-and-reallocation)*. If it is important to know the exact allocated capacity of a `Vec`, always use the [`capacity`](struct.vec#method.capacity) method after construction. For `Vec<T, A>` where `T` is a zero-sized type, there will be no allocation and the capacity will always be `usize::MAX`. ##### Panics Panics if the new capacity exceeds `isize::MAX` bytes. ##### Examples ``` #![feature(allocator_api)] use std::alloc::System; let mut vec = Vec::with_capacity_in(10, System); // The vector contains no items, even though it has capacity for more assert_eq!(vec.len(), 0); assert_eq!(vec.capacity(), 10); // These are all done without reallocating... for i in 0..10 { vec.push(i); } assert_eq!(vec.len(), 10); assert_eq!(vec.capacity(), 10); // ...but this may make the vector reallocate vec.push(11); assert_eq!(vec.len(), 11); assert!(vec.capacity() >= 11); // A vector of a zero-sized type will always over-allocate, since no // allocation is necessary let vec_units = Vec::<(), System>::with_capacity_in(10, System); assert_eq!(vec_units.capacity(), usize::MAX); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#716)#### pub unsafe fn from\_raw\_parts\_in( ptr: \*mut T, length: usize, capacity: usize, alloc: A) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Creates a `Vec<T, A>` directly from the raw components of another vector. ##### Safety This is highly unsafe, due to the number of invariants that aren’t checked: * `ptr` needs to have been previously allocated via [`String`](../string/struct.string)/`Vec<T>` (at least, it’s highly likely to be incorrect if it wasn’t). * `T` needs to have the same size and alignment as what `ptr` was allocated with. (`T` having a less strict alignment is not sufficient, the alignment really needs to be equal to satisfy the [`dealloc`](../alloc/trait.globalalloc#tymethod.dealloc) requirement that memory must be allocated and deallocated with the same layout.) * `length` needs to be less than or equal to `capacity`. * `capacity` needs to be the capacity that the pointer was allocated with. Violating these may cause problems like corrupting the allocator’s internal data structures. For example it is **not** safe to build a `Vec<u8>` from a pointer to a C `char` array with length `size_t`. It’s also not safe to build one from a `Vec<u16>` and its length, because the allocator cares about the alignment, and these two types have different alignments. The buffer was allocated with alignment 2 (for `u16`), but after turning it into a `Vec<u8>` it’ll be deallocated with alignment 1. The ownership of `ptr` is effectively transferred to the `Vec<T>` which may then deallocate, reallocate or change the contents of memory pointed to by the pointer at will. Ensure that nothing else uses the pointer after calling this function. ##### Examples ``` #![feature(allocator_api)] use std::alloc::System; use std::ptr; use std::mem; let mut v = Vec::with_capacity_in(3, System); v.push(1); v.push(2); v.push(3); // Prevent running `v`'s destructor so we are in complete control // of the allocation. let mut v = mem::ManuallyDrop::new(v); // Pull out the various important pieces of information about `v` let p = v.as_mut_ptr(); let len = v.len(); let cap = v.capacity(); let alloc = v.allocator(); unsafe { // Overwrite memory with 4, 5, 6 for i in 0..len { ptr::write(p.add(i), 4 + i); } // Put everything back together into a Vec let rebuilt = Vec::from_raw_parts_in(p, len, cap, alloc.clone()); assert_eq!(rebuilt, [4, 5, 6]); } ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#753)#### pub fn into\_raw\_parts(self) -> (\*mut T, usize, usize) 🔬This is a nightly-only experimental API. (`vec_into_raw_parts` [#65816](https://github.com/rust-lang/rust/issues/65816)) Decomposes a `Vec<T>` into its raw components. Returns the raw pointer to the underlying data, the length of the vector (in elements), and the allocated capacity of the data (in elements). These are the same arguments in the same order as the arguments to [`from_raw_parts`](struct.vec#method.from_raw_parts). After calling this function, the caller is responsible for the memory previously managed by the `Vec`. The only way to do this is to convert the raw pointer, length, and capacity back into a `Vec` with the [`from_raw_parts`](struct.vec#method.from_raw_parts) function, allowing the destructor to perform the cleanup. ##### Examples ``` #![feature(vec_into_raw_parts)] let v: Vec<i32> = vec![-1, 0, 1]; let (ptr, len, cap) = v.into_raw_parts(); let rebuilt = unsafe { // We can now make changes to the components, such as // transmuting the raw pointer to a compatible type. let ptr = ptr as *mut u32; Vec::from_raw_parts(ptr, len, cap) }; assert_eq!(rebuilt, [4294967295, 0, 1]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#797)#### pub fn into\_raw\_parts\_with\_alloc(self) -> (\*mut T, usize, usize, A) 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Decomposes a `Vec<T>` into its raw components. Returns the raw pointer to the underlying data, the length of the vector (in elements), the allocated capacity of the data (in elements), and the allocator. These are the same arguments in the same order as the arguments to [`from_raw_parts_in`](struct.vec#method.from_raw_parts_in). After calling this function, the caller is responsible for the memory previously managed by the `Vec`. The only way to do this is to convert the raw pointer, length, and capacity back into a `Vec` with the [`from_raw_parts_in`](struct.vec#method.from_raw_parts_in) function, allowing the destructor to perform the cleanup. ##### Examples ``` #![feature(allocator_api, vec_into_raw_parts)] use std::alloc::System; let mut v: Vec<i32, System> = Vec::new_in(System); v.push(-1); v.push(0); v.push(1); let (ptr, len, cap, alloc) = v.into_raw_parts_with_alloc(); let rebuilt = unsafe { // We can now make changes to the components, such as // transmuting the raw pointer to a compatible type. let ptr = ptr as *mut u32; Vec::from_raw_parts_in(ptr, len, cap, alloc) }; assert_eq!(rebuilt, [4294967295, 0, 1]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#817)#### pub fn capacity(&self) -> usize Returns the number of elements the vector can hold without reallocating. ##### Examples ``` let vec: Vec<i32> = Vec::with_capacity(10); assert_eq!(vec.capacity(), 10); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#840)#### pub fn reserve(&mut self, additional: usize) Reserves capacity for at least `additional` more elements to be inserted in the given `Vec<T>`. The collection may reserve more space to speculatively avoid frequent reallocations. After calling `reserve`, capacity will be greater than or equal to `self.len() + additional`. Does nothing if capacity is already sufficient. ##### Panics Panics if the new capacity exceeds `isize::MAX` bytes. ##### Examples ``` let mut vec = vec![1]; vec.reserve(10); assert!(vec.capacity() >= 11); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#870)#### pub fn reserve\_exact(&mut self, additional: usize) Reserves the minimum capacity for at least `additional` more elements to be inserted in the given `Vec<T>`. Unlike [`reserve`](struct.vec#method.reserve), this will not deliberately over-allocate to speculatively avoid frequent allocations. After calling `reserve_exact`, capacity will be greater than or equal to `self.len() + additional`. Does nothing if the capacity is already sufficient. Note that the allocator may give the collection more space than it requests. Therefore, capacity can not be relied upon to be precisely minimal. Prefer [`reserve`](struct.vec#method.reserve) if future insertions are expected. ##### Panics Panics if the new capacity exceeds `isize::MAX` bytes. ##### Examples ``` let mut vec = vec![1]; vec.reserve_exact(10); assert!(vec.capacity() >= 11); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#907)1.57.0 · #### pub fn try\_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> Tries to reserve capacity for at least `additional` more elements to be inserted in the given `Vec<T>`. The collection may reserve more space to speculatively avoid frequent reallocations. After calling `try_reserve`, capacity will be greater than or equal to `self.len() + additional` if it returns `Ok(())`. Does nothing if capacity is already sufficient. This method preserves the contents even if an error occurs. ##### Errors If the capacity overflows, or the allocator reports a failure, then an error is returned. ##### Examples ``` use std::collections::TryReserveError; fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> { let mut output = Vec::new(); // Pre-reserve the memory, exiting if we can't output.try_reserve(data.len())?; // Now we know this can't OOM in the middle of our complex work output.extend(data.iter().map(|&val| { val * 2 + 5 // very complicated })); Ok(output) } ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#950)1.57.0 · #### pub fn try\_reserve\_exact( &mut self, additional: usize) -> Result<(), TryReserveError> Tries to reserve the minimum capacity for at least `additional` elements to be inserted in the given `Vec<T>`. Unlike [`try_reserve`](struct.vec#method.try_reserve), this will not deliberately over-allocate to speculatively avoid frequent allocations. After calling `try_reserve_exact`, capacity will be greater than or equal to `self.len() + additional` if it returns `Ok(())`. Does nothing if the capacity is already sufficient. Note that the allocator may give the collection more space than it requests. Therefore, capacity can not be relied upon to be precisely minimal. Prefer [`try_reserve`](struct.vec#method.try_reserve) if future insertions are expected. ##### Errors If the capacity overflows, or the allocator reports a failure, then an error is returned. ##### Examples ``` use std::collections::TryReserveError; fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> { let mut output = Vec::new(); // Pre-reserve the memory, exiting if we can't output.try_reserve_exact(data.len())?; // Now we know this can't OOM in the middle of our complex work output.extend(data.iter().map(|&val| { val * 2 + 5 // very complicated })); Ok(output) } ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#970)#### pub fn shrink\_to\_fit(&mut self) Shrinks the capacity of the vector as much as possible. It will drop down as close as possible to the length but the allocator may still inform the vector that there is space for a few more elements. ##### Examples ``` let mut vec = Vec::with_capacity(10); vec.extend([1, 2, 3]); assert_eq!(vec.capacity(), 10); vec.shrink_to_fit(); assert!(vec.capacity() >= 3); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#999)1.56.0 · #### pub fn shrink\_to(&mut self, min\_capacity: usize) Shrinks the capacity of the vector with a lower bound. The capacity will remain at least as large as both the length and the supplied value. If the current capacity is less than the lower limit, this is a no-op. ##### Examples ``` let mut vec = Vec::with_capacity(10); vec.extend([1, 2, 3]); assert_eq!(vec.capacity(), 10); vec.shrink_to(4); assert!(vec.capacity() >= 4); vec.shrink_to(0); assert!(vec.capacity() >= 3); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1031)#### pub fn into\_boxed\_slice(self) -> Box<[T], A> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts the vector into [`Box<[T]>`](../boxed/struct.box). Note that this will drop any excess capacity. ##### Examples ``` let v = vec![1, 2, 3]; let slice = v.into_boxed_slice(); ``` Any excess capacity is removed: ``` let mut vec = Vec::with_capacity(10); vec.extend([1, 2, 3]); assert_eq!(vec.capacity(), 10); let slice = vec.into_boxed_slice(); assert_eq!(slice.into_vec().capacity(), 3); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1084)#### pub fn truncate(&mut self, len: usize) Shortens the vector, keeping the first `len` elements and dropping the rest. If `len` is greater than the vector’s current length, this has no effect. The [`drain`](struct.vec#method.drain) method can emulate `truncate`, but causes the excess elements to be returned instead of dropped. Note that this method has no effect on the allocated capacity of the vector. ##### Examples Truncating a five element vector to two elements: ``` let mut vec = vec![1, 2, 3, 4, 5]; vec.truncate(2); assert_eq!(vec, [1, 2]); ``` No truncation occurs when `len` is greater than the vector’s current length: ``` let mut vec = vec![1, 2, 3]; vec.truncate(8); assert_eq!(vec, [1, 2, 3]); ``` Truncating when `len == 0` is equivalent to calling the [`clear`](struct.vec#method.clear) method. ``` let mut vec = vec![1, 2, 3]; vec.truncate(0); assert_eq!(vec, []); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1119)1.7.0 · #### pub fn as\_slice(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Extracts a slice containing the entire vector. Equivalent to `&s[..]`. ##### Examples ``` use std::io::{self, Write}; let buffer = vec![1, 2, 3, 5, 8]; io::sink().write(buffer.as_slice()).unwrap(); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1136)1.7.0 · #### pub fn as\_mut\_slice(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Extracts a mutable slice of the entire vector. Equivalent to `&mut s[..]`. ##### Examples ``` use std::io::{self, Read}; let mut buffer = vec![0; 3]; io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap(); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1168)1.37.0 · #### pub fn as\_ptr(&self) -> \*const T Returns a raw pointer to the vector’s buffer, or a dangling raw pointer valid for zero sized reads if the vector didn’t allocate. The caller must ensure that the vector outlives the pointer this function returns, or else it will end up pointing to garbage. Modifying the vector may cause its buffer to be reallocated, which would also make any pointers to it invalid. The caller must also ensure that the memory the pointer (non-transitively) points to is never written to (except inside an `UnsafeCell`) using this pointer or any pointer derived from it. If you need to mutate the contents of the slice, use [`as_mut_ptr`](struct.vec#method.as_mut_ptr). ##### Examples ``` let x = vec![1, 2, 4]; let x_ptr = x.as_ptr(); unsafe { for i in 0..x.len() { assert_eq!(*x_ptr.add(i), 1 << i); } } ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1205)1.37.0 · #### pub fn as\_mut\_ptr(&mut self) -> \*mut T Returns an unsafe mutable pointer to the vector’s buffer, or a dangling raw pointer valid for zero sized reads if the vector didn’t allocate. The caller must ensure that the vector outlives the pointer this function returns, or else it will end up pointing to garbage. Modifying the vector may cause its buffer to be reallocated, which would also make any pointers to it invalid. ##### Examples ``` // Allocate vector big enough for 4 elements. let size = 4; let mut x: Vec<i32> = Vec::with_capacity(size); let x_ptr = x.as_mut_ptr(); // Initialize elements via raw pointer writes, then set length. unsafe { for i in 0..size { *x_ptr.add(i) = i as i32; } x.set_len(size); } assert_eq!(&*x, &[0, 1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1218)#### pub fn allocator(&self) -> &A 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Returns a reference to the underlying allocator. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1302)#### pub unsafe fn set\_len(&mut self, new\_len: usize) Forces the length of the vector to `new_len`. This is a low-level operation that maintains none of the normal invariants of the type. Normally changing the length of a vector is done using one of the safe operations instead, such as [`truncate`](struct.vec#method.truncate), [`resize`](struct.vec#method.resize), [`extend`](../iter/trait.extend#tymethod.extend), or [`clear`](struct.vec#method.clear). ##### Safety * `new_len` must be less than or equal to [`capacity()`](struct.vec#method.capacity). * The elements at `old_len..new_len` must be initialized. ##### Examples This method can be useful for situations in which the vector is serving as a buffer for other code, particularly over FFI: ``` pub fn get_dictionary(&self) -> Option<Vec<u8>> { // Per the FFI method's docs, "32768 bytes is always enough". let mut dict = Vec::with_capacity(32_768); let mut dict_length = 0; // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that: // 1. `dict_length` elements were initialized. // 2. `dict_length` <= the capacity (32_768) // which makes `set_len` safe to call. unsafe { // Make the FFI call... let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length); if r == Z_OK { // ...and update the length to what was initialized. dict.set_len(dict_length); Some(dict) } else { None } } } ``` While the following example is sound, there is a memory leak since the inner vectors were not freed prior to the `set_len` call: ``` let mut vec = vec![vec![1, 0, 0], vec![0, 1, 0], vec![0, 0, 1]]; // SAFETY: // 1. `old_len..0` is empty so no elements need to be initialized. // 2. `0 <= capacity` always holds whatever `capacity` is. unsafe { vec.set_len(0); } ``` Normally, here, one would use [`clear`](struct.vec#method.clear) instead to correctly drop the contents and thus not leak memory. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1334)#### pub fn swap\_remove(&mut self, index: usize) -> T Removes an element from the vector and returns it. The removed element is replaced by the last element of the vector. This does not preserve ordering, but is *O*(1). If you need to preserve the element order, use [`remove`](struct.vec#method.remove) instead. ##### Panics Panics if `index` is out of bounds. ##### Examples ``` let mut v = vec!["foo", "bar", "baz", "qux"]; assert_eq!(v.swap_remove(1), "bar"); assert_eq!(v, ["foo", "qux", "baz"]); assert_eq!(v.swap_remove(0), "foo"); assert_eq!(v, ["baz", "qux"]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1375)#### pub fn insert(&mut self, index: usize, element: T) Inserts an element at position `index` within the vector, shifting all elements after it to the right. ##### Panics Panics if `index > len`. ##### Examples ``` let mut vec = vec![1, 2, 3]; vec.insert(1, 4); assert_eq!(vec, [1, 4, 2, 3]); vec.insert(4, 5); assert_eq!(vec, [1, 4, 2, 3, 5]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1436)#### pub fn remove(&mut self, index: usize) -> T Removes and returns the element at position `index` within the vector, shifting all elements after it to the left. Note: Because this shifts over the remaining elements, it has a worst-case performance of *O*(*n*). If you don’t need the order of elements to be preserved, use [`swap_remove`](struct.vec#method.swap_remove) instead. If you’d like to remove elements from the beginning of the `Vec`, consider using [`VecDeque::pop_front`](../collections/struct.vecdeque#method.pop_front) instead. ##### Panics Panics if `index` is out of bounds. ##### Examples ``` let mut v = vec![1, 2, 3]; assert_eq!(v.remove(1), 2); assert_eq!(v, [1, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1491-1493)#### pub fn retain<F>(&mut self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Retains only the elements specified by the predicate. In other words, remove all elements `e` for which `f(&e)` returns `false`. This method operates in place, visiting each element exactly once in the original order, and preserves the order of the retained elements. ##### Examples ``` let mut vec = vec![1, 2, 3, 4]; vec.retain(|&x| x % 2 == 0); assert_eq!(vec, [2, 4]); ``` Because the elements are visited exactly once in the original order, external state may be used to decide which elements to keep. ``` let mut vec = vec![1, 2, 3, 4, 5]; let keep = [false, true, true, false, true]; let mut iter = keep.iter(); vec.retain(|_| *iter.next().unwrap()); assert_eq!(vec, [2, 3, 5]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1517-1519)1.61.0 · #### pub fn retain\_mut<F>(&mut self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), Retains only the elements specified by the predicate, passing a mutable reference to it. In other words, remove all elements `e` such that `f(&mut e)` returns `false`. This method operates in place, visiting each element exactly once in the original order, and preserves the order of the retained elements. ##### Examples ``` let mut vec = vec![1, 2, 3, 4]; vec.retain_mut(|x| if *x <= 3 { *x += 1; true } else { false }); assert_eq!(vec, [2, 3, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1626-1629)1.16.0 · #### pub fn dedup\_by\_key<F, K>(&mut self, key: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> K, K: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<K>, Removes all but the first of consecutive elements in the vector that resolve to the same key. If the vector is sorted, this removes all duplicates. ##### Examples ``` let mut vec = vec![10, 20, 21, 30, 20]; vec.dedup_by_key(|i| *i / 10); assert_eq!(vec, [10, 20, 30, 20]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1653-1655)1.16.0 · #### pub fn dedup\_by<F>(&mut self, same\_bucket: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T, [&mut](../primitive.reference) T) -> [bool](../primitive.bool), Removes all but the first of consecutive elements in the vector satisfying a given equality relation. The `same_bucket` function is passed references to two elements from the vector and must determine if the elements compare equal. The elements are passed in opposite order from their order in the slice, so if `same_bucket(a, b)` returns `true`, `a` is removed. If the vector is sorted, this removes all duplicates. ##### Examples ``` let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"]; vec.dedup_by(|a, b| a.eq_ignore_ascii_case(b)); assert_eq!(vec, ["foo", "bar", "baz", "bar"]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1764)#### pub fn push(&mut self, value: T) Appends an element to the back of a collection. ##### Panics Panics if the new capacity exceeds `isize::MAX` bytes. ##### Examples ``` let mut vec = vec![1, 2]; vec.push(3); assert_eq!(vec, [1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1794)#### pub fn pop(&mut self) -> Option<T> Removes the last element from a vector and returns it, or [`None`](../option/enum.option#variant.None "None") if it is empty. If you’d like to pop the first element, consider using [`VecDeque::pop_front`](../collections/struct.vecdeque#method.pop_front) instead. ##### Examples ``` let mut vec = vec![1, 2, 3]; assert_eq!(vec.pop(), Some(3)); assert_eq!(vec, [1, 2]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1823)1.4.0 · #### pub fn append(&mut self, other: &mut Vec<T, A>) Moves all the elements of `other` into `self`, leaving `other` empty. ##### Panics Panics if the new capacity exceeds `isize::MAX` bytes. ##### Examples ``` let mut vec = vec![1, 2, 3]; let mut vec2 = vec![4, 5, 6]; vec.append(&mut vec2); assert_eq!(vec, [1, 2, 3, 4, 5, 6]); assert_eq!(vec2, []); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1872-1874)1.6.0 · #### pub fn drain<R>(&mut self, range: R) -> Drain<'\_, T, A>where R: [RangeBounds](../ops/trait.rangebounds "trait std::ops::RangeBounds")<[usize](../primitive.usize)>, Notable traits for [Drain](struct.drain "struct std::vec::Drain")<'\_, T, A> ``` impl<T, A> Iterator for Drain<'_, T, A>where     A: Allocator, type Item = T; ``` Removes the specified range from the vector in bulk, returning all removed elements as an iterator. If the iterator is dropped before being fully consumed, it drops the remaining removed elements. The returned iterator keeps a mutable borrow on the vector to optimize its implementation. ##### Panics Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector. ##### Leaking If the returned iterator goes out of scope without being dropped (due to [`mem::forget`](../mem/fn.forget "mem::forget"), for example), the vector may have lost and leaked elements arbitrarily, including elements outside the range. ##### Examples ``` let mut v = vec![1, 2, 3]; let u: Vec<_> = v.drain(1..).collect(); assert_eq!(v, &[1]); assert_eq!(u, &[2, 3]); // A full range clears the vector, like `clear()` does v.drain(..); assert_eq!(v, &[]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1920)#### pub fn clear(&mut self) Clears the vector, removing all values. Note that this method has no effect on the allocated capacity of the vector. ##### Examples ``` let mut v = vec![1, 2, 3]; v.clear(); assert!(v.is_empty()); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1946)#### pub fn len(&self) -> usize Returns the number of elements in the vector, also referred to as its ‘length’. ##### Examples ``` let a = vec![1, 2, 3]; assert_eq!(a.len(), 3); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1962)#### pub fn is\_empty(&self) -> bool Returns `true` if the vector contains no elements. ##### Examples ``` let mut v = Vec::new(); assert!(v.is_empty()); v.push(1); assert!(!v.is_empty()); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1988-1990)1.4.0 · #### pub fn split\_off(&mut self, at: usize) -> Vec<T, A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Splits the collection into two at the given index. Returns a newly allocated vector containing the elements in the range `[at, len)`. After the call, the original vector will be left containing the elements `[0, at)` with its previous capacity unchanged. ##### Panics Panics if `at > len`. ##### Examples ``` let mut vec = vec![1, 2, 3]; let vec2 = vec.split_off(1); assert_eq!(vec, [1]); assert_eq!(vec2, [2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2051-2053)1.33.0 · #### pub fn resize\_with<F>(&mut self, new\_len: usize, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> T, Resizes the `Vec` in-place so that `len` is equal to `new_len`. If `new_len` is greater than `len`, the `Vec` is extended by the difference, with each additional slot filled with the result of calling the closure `f`. The return values from `f` will end up in the `Vec` in the order they have been generated. If `new_len` is less than `len`, the `Vec` is simply truncated. This method uses a closure to create new values on every push. If you’d rather [`Clone`](../clone/trait.clone "Clone") a given value, use [`Vec::resize`](struct.vec#method.resize "Vec::resize"). If you want to use the [`Default`](../default/trait.default "Default") trait to generate values, you can pass [`Default::default`](../default/trait.default#tymethod.default "Default::default") as the second argument. ##### Examples ``` let mut vec = vec![1, 2, 3]; vec.resize_with(5, Default::default); assert_eq!(vec, [1, 2, 3, 0, 0]); let mut vec = vec![]; let mut p = 1; vec.resize_with(4, || { p *= 2; p }); assert_eq!(vec, [2, 4, 8, 16]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2089-2091)1.47.0 · #### pub fn leak<'a>(self) -> &'a mut [T]where A: 'a, Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Consumes and leaks the `Vec`, returning a mutable reference to the contents, `&'a mut [T]`. Note that the type `T` must outlive the chosen lifetime `'a`. If the type has only static references, or none at all, then this may be chosen to be `'static`. As of Rust 1.57, this method does not reallocate or shrink the `Vec`, so the leaked allocation may include unused capacity that is not part of the returned slice. This function is mainly useful for data that lives for the remainder of the program’s life. Dropping the returned reference will cause a memory leak. ##### Examples Simple usage: ``` let x = vec![1, 2, 3]; let static_ref: &'static mut [usize] = x.leak(); static_ref[0] += 1; assert_eq!(static_ref, &[2, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2127)1.60.0 · #### pub fn spare\_capacity\_mut(&mut self) -> &mut [MaybeUninit<T>] Returns the remaining spare capacity of the vector as a slice of `MaybeUninit<T>`. The returned slice can be used to fill the vector with data (e.g. by reading from a file) before marking the data as initialized using the [`set_len`](struct.vec#method.set_len) method. ##### Examples ``` // Allocate vector big enough for 10 elements. let mut v = Vec::with_capacity(10); // Fill in the first 3 elements. let uninit = v.spare_capacity_mut(); uninit[0].write(0); uninit[1].write(1); uninit[2].write(2); // Mark the first 3 elements of the vector as being initialized. unsafe { v.set_len(3); } assert_eq!(&v, &[0, 1, 2]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2192)#### pub fn split\_at\_spare\_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]) 🔬This is a nightly-only experimental API. (`vec_split_at_spare` [#81944](https://github.com/rust-lang/rust/issues/81944)) Returns vector content as a slice of `T`, along with the remaining spare capacity of the vector as a slice of `MaybeUninit<T>`. The returned spare capacity slice can be used to fill the vector with data (e.g. by reading from a file) before marking the data as initialized using the [`set_len`](struct.vec#method.set_len) method. Note that this is a low-level API, which should be used with care for optimization purposes. If you need to append data to a `Vec` you can use [`push`](struct.vec#method.push), [`extend`](struct.vec#method.extend), [`extend_from_slice`](struct.vec#method.extend_from_slice), [`extend_from_within`](struct.vec#method.extend_from_within), [`insert`](struct.vec#method.insert), [`append`](struct.vec#method.append), [`resize`](struct.vec#method.resize) or [`resize_with`](struct.vec#method.resize_with), depending on your exact needs. ##### Examples ``` #![feature(vec_split_at_spare)] let mut v = vec![1, 1, 2]; // Reserve additional space big enough for 10 elements. v.reserve(10); let (init, uninit) = v.split_at_spare_mut(); let sum = init.iter().copied().sum::<u32>(); // Fill in the next 4 elements. uninit[0].write(sum); uninit[1].write(sum * 2); uninit[2].write(sum * 3); uninit[3].write(sum * 4); // Mark the 4 elements of the vector as being initialized. unsafe { let len = v.len(); v.set_len(len + 4); } assert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2226)### impl<T, A> Vec<T, A>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2252)1.5.0 · #### pub fn resize(&mut self, new\_len: usize, value: T) Resizes the `Vec` in-place so that `len` is equal to `new_len`. If `new_len` is greater than `len`, the `Vec` is extended by the difference, with each additional slot filled with `value`. If `new_len` is less than `len`, the `Vec` is simply truncated. This method requires `T` to implement [`Clone`](../clone/trait.clone "Clone"), in order to be able to clone the passed value. If you need more flexibility (or want to rely on [`Default`](../default/trait.default "Default") instead of [`Clone`](../clone/trait.clone "Clone")), use [`Vec::resize_with`](struct.vec#method.resize_with "Vec::resize_with"). If you only need to resize to a smaller size, use [`Vec::truncate`](struct.vec#method.truncate "Vec::truncate"). ##### Examples ``` let mut vec = vec!["hello"]; vec.resize(3, "world"); assert_eq!(vec, ["hello", "world", "world"]); let mut vec = vec![1, 2, 3, 4]; vec.resize(2, 0); assert_eq!(vec, [1, 2]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2283)1.6.0 · #### pub fn extend\_from\_slice(&mut self, other: &[T]) Clones and appends all elements in a slice to the `Vec`. Iterates over the slice `other`, clones each element, and then appends it to this `Vec`. The `other` slice is traversed in-order. Note that this function is same as [`extend`](struct.vec#method.extend) except that it is specialized to work with slices instead. If and when Rust gets specialization this function will likely be deprecated (but still available). ##### Examples ``` let mut vec = vec![1]; vec.extend_from_slice(&[2, 3, 4]); assert_eq!(vec, [1, 2, 3, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2310-2312)1.53.0 · #### pub fn extend\_from\_within<R>(&mut self, src: R)where R: [RangeBounds](../ops/trait.rangebounds "trait std::ops::RangeBounds")<[usize](../primitive.usize)>, Copies elements from `src` range to the end of the vector. ##### Panics Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector. ##### Examples ``` let mut vec = vec![0, 1, 2, 3, 4]; vec.extend_from_within(2..); assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]); vec.extend_from_within(..2); assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]); vec.extend_from_within(4..8); assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2325)### impl<T, A, const N: usize> Vec<[T; N], A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2348)#### pub fn into\_flattened(self) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` 🔬This is a nightly-only experimental API. (`slice_flatten` [#95629](https://github.com/rust-lang/rust/issues/95629)) Takes a `Vec<[T; N]>` and flattens it into a `Vec<T>`. ##### Panics Panics if the length of the resulting vector would overflow a `usize`. This is only possible when flattening a vector of arrays of zero-sized types, and thus tends to be irrelevant in practice. If `size_of::<T>() > 0`, this will never panic. ##### Examples ``` #![feature(slice_flatten)] let mut vec = vec![[1, 2, 3], [4, 5, 6], [7, 8, 9]]; assert_eq!(vec.pop(), Some([7, 8, 9])); let mut flattened = vec.into_flattened(); assert_eq!(flattened.pop(), Some(6)); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2428)### impl<T, A> Vec<T, A>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2445)#### pub fn dedup(&mut self) Removes consecutive repeated elements in the vector according to the [`PartialEq`](../cmp/trait.partialeq "PartialEq") trait implementation. If the vector is sorted, this removes all duplicates. ##### Examples ``` let mut vec = vec![1, 2, 2, 3, 2]; vec.dedup(); assert_eq!(vec, [1, 2, 3, 2]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2737)### impl<T, A> Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2801-2804)1.21.0 · #### pub fn splice<R, I>( &mut self, range: R, replace\_with: I) -> Splice<'\_, <I as IntoIterator>::IntoIter, A>where R: [RangeBounds](../ops/trait.rangebounds "trait std::ops::RangeBounds")<[usize](../primitive.usize)>, I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = T>, Notable traits for [Splice](struct.splice "struct std::vec::Splice")<'\_, I, A> ``` impl<I, A> Iterator for Splice<'_, I, A>where     I: Iterator,     A: Allocator, type Item = <I as Iterator>::Item; ``` Creates a splicing iterator that replaces the specified range in the vector with the given `replace_with` iterator and yields the removed items. `replace_with` does not need to be the same length as `range`. `range` is removed even if the iterator is not consumed until the end. It is unspecified how many elements are removed from the vector if the `Splice` value is leaked. The input iterator `replace_with` is only consumed when the `Splice` value is dropped. This is optimal if: * The tail (elements in the vector after `range`) is empty, * or `replace_with` yields fewer or equal elements than `range`’s length * or the lower bound of its `size_hint()` is exact. Otherwise, a temporary vector is allocated and the tail is moved twice. ##### Panics Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector. ##### Examples ``` let mut v = vec![1, 2, 3, 4]; let new = [7, 8, 9]; let u: Vec<_> = v.splice(1..3, new).collect(); assert_eq!(v, &[1, 7, 8, 9, 4]); assert_eq!(u, &[2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2854-2856)#### pub fn drain\_filter<F>(&mut self, filter: F) -> DrainFilter<'\_, T, F, A>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), Notable traits for [DrainFilter](struct.drainfilter "struct std::vec::DrainFilter")<'\_, T, F, A> ``` impl<T, F, A> Iterator for DrainFilter<'_, T, F, A>where     A: Allocator,     F: FnMut(&mut T) -> bool, type Item = T; ``` 🔬This is a nightly-only experimental API. (`drain_filter` [#43244](https://github.com/rust-lang/rust/issues/43244)) Creates an iterator which uses a closure to determine if an element should be removed. If the closure returns true, then the element is removed and yielded. If the closure returns false, the element will remain in the vector and will not be yielded by the iterator. Using this method is equivalent to the following code: ``` let mut i = 0; while i < vec.len() { if some_predicate(&mut vec[i]) { let val = vec.remove(i); // your code here } else { i += 1; } } ``` But `drain_filter` is easier to use. `drain_filter` is also more efficient, because it can backshift the elements of the array in bulk. Note that `drain_filter` also lets you mutate every element in the filter closure, regardless of whether you choose to keep or remove it. ##### Examples Splitting an array into evens and odds, reusing the original allocation: ``` #![feature(drain_filter)] let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15]; let evens = numbers.drain_filter(|x| *x % 2 == 0).collect::<Vec<_>>(); let odds = numbers; assert_eq!(evens, vec![2, 4, 6, 8, 14]); assert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]); ``` Methods from [Deref](../ops/trait.deref "trait std::ops::Deref")<Target = [[T]](../primitive.slice)> ---------------------------------------------------------------------------------------------------- [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4068)#### pub fn flatten(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_flatten` [#95629](https://github.com/rust-lang/rust/issues/95629)) Takes a `&[[T; N]]`, and flattens it to a `&[T]`. ##### Panics This panics if the length of the resulting slice would overflow a `usize`. This is only possible when flattening a slice of arrays of zero-sized types, and thus tends to be irrelevant in practice. If `size_of::<T>() > 0`, this will never panic. ##### Examples ``` #![feature(slice_flatten)] assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]); assert_eq!( [[1, 2, 3], [4, 5, 6]].flatten(), [[1, 2], [3, 4], [5, 6]].flatten(), ); let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []]; assert!(slice_of_empty_arrays.flatten().is_empty()); let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.flatten().is_empty()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4106)#### pub fn flatten\_mut(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_flatten` [#95629](https://github.com/rust-lang/rust/issues/95629)) Takes a `&mut [[T; N]]`, and flattens it to a `&mut [T]`. ##### Panics This panics if the length of the resulting slice would overflow a `usize`. This is only possible when flattening a slice of arrays of zero-sized types, and thus tends to be irrelevant in practice. If `size_of::<T>() > 0`, this will never panic. ##### Examples ``` #![feature(slice_flatten)] fn add_5_to_all(slice: &mut [i32]) { for i in slice { *i += 5; } } let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.flatten_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4172)#### pub fn sort\_floats(&mut self) 🔬This is a nightly-only experimental API. (`sort_floats` [#93396](https://github.com/rust-lang/rust/issues/93396)) Sorts the slice of floats. This sort is in-place (i.e. does not allocate), *O*(*n* \* log(*n*)) worst-case, and uses the ordering defined by [`f64::total_cmp`](../primitive.f64#method.total_cmp "f64::total_cmp"). ##### Current implementation This uses the same sorting algorithm as [`sort_unstable_by`](../primitive.slice#method.sort_unstable_by). ##### Examples ``` #![feature(sort_floats)] let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0]; v.sort_floats(); let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4143)#### pub fn sort\_floats(&mut self) 🔬This is a nightly-only experimental API. (`sort_floats` [#93396](https://github.com/rust-lang/rust/issues/93396)) Sorts the slice of floats. This sort is in-place (i.e. does not allocate), *O*(*n* \* log(*n*)) worst-case, and uses the ordering defined by [`f32::total_cmp`](../primitive.f32#method.total_cmp "f32::total_cmp"). ##### Current implementation This uses the same sorting algorithm as [`sort_unstable_by`](../primitive.slice#method.sort_unstable_by). ##### Examples ``` #![feature(sort_floats)] let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0]; v.sort_floats(); let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#129)#### pub fn len(&self) -> usize Returns the number of elements in the slice. ##### Examples ``` let a = [1, 2, 3]; assert_eq!(a.len(), 3); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#152)#### pub fn is\_empty(&self) -> bool Returns `true` if the slice has a length of 0. ##### Examples ``` let a = [1, 2, 3]; assert!(!a.is_empty()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#171)#### pub fn first(&self) -> Option<&T> Returns the first element of the slice, or `None` if it is empty. ##### Examples ``` let v = [10, 40, 30]; assert_eq!(Some(&10), v.first()); let w: &[i32] = &[]; assert_eq!(None, w.first()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#191)#### pub fn first\_mut(&mut self) -> Option<&mut T> Returns a mutable pointer to the first element of the slice, or `None` if it is empty. ##### Examples ``` let x = &mut [0, 1, 2]; if let Some(first) = x.first_mut() { *first = 5; } assert_eq!(x, &[5, 1, 2]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#211)1.5.0 · #### pub fn split\_first(&self) -> Option<(&T, &[T])> Returns the first and all the rest of the elements of the slice, or `None` if it is empty. ##### Examples ``` let x = &[0, 1, 2]; if let Some((first, elements)) = x.split_first() { assert_eq!(first, &0); assert_eq!(elements, &[1, 2]); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#233)1.5.0 · #### pub fn split\_first\_mut(&mut self) -> Option<(&mut T, &mut [T])> Returns the first and all the rest of the elements of the slice, or `None` if it is empty. ##### Examples ``` let x = &mut [0, 1, 2]; if let Some((first, elements)) = x.split_first_mut() { *first = 3; elements[0] = 4; elements[1] = 5; } assert_eq!(x, &[3, 4, 5]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#253)1.5.0 · #### pub fn split\_last(&self) -> Option<(&T, &[T])> Returns the last and all the rest of the elements of the slice, or `None` if it is empty. ##### Examples ``` let x = &[0, 1, 2]; if let Some((last, elements)) = x.split_last() { assert_eq!(last, &2); assert_eq!(elements, &[0, 1]); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#275)1.5.0 · #### pub fn split\_last\_mut(&mut self) -> Option<(&mut T, &mut [T])> Returns the last and all the rest of the elements of the slice, or `None` if it is empty. ##### Examples ``` let x = &mut [0, 1, 2]; if let Some((last, elements)) = x.split_last_mut() { *last = 3; elements[0] = 4; elements[1] = 5; } assert_eq!(x, &[4, 5, 3]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#294)#### pub fn last(&self) -> Option<&T> Returns the last element of the slice, or `None` if it is empty. ##### Examples ``` let v = [10, 40, 30]; assert_eq!(Some(&30), v.last()); let w: &[i32] = &[]; assert_eq!(None, w.last()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#314)#### pub fn last\_mut(&mut self) -> Option<&mut T> Returns a mutable pointer to the last item in the slice. ##### Examples ``` let x = &mut [0, 1, 2]; if let Some(last) = x.last_mut() { *last = 10; } assert_eq!(x, &[0, 1, 10]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#339-341)#### pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, Returns a reference to an element or subslice depending on the type of index. * If given a position, returns a reference to the element at that position or `None` if out of bounds. * If given a range, returns the subslice corresponding to that range, or `None` if out of bounds. ##### Examples ``` let v = [10, 40, 30]; assert_eq!(Some(&40), v.get(1)); assert_eq!(Some(&[10, 40][..]), v.get(0..2)); assert_eq!(None, v.get(3)); assert_eq!(None, v.get(0..4)); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#365-367)#### pub fn get\_mut<I>( &mut self, index: I) -> Option<&mut <I as SliceIndex<[T]>>::Output>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, Returns a mutable reference to an element or subslice depending on the type of index (see [`get`](../primitive.slice#method.get)) or `None` if the index is out of bounds. ##### Examples ``` let x = &mut [0, 1, 2]; if let Some(elem) = x.get_mut(1) { *elem = 42; } assert_eq!(x, &[0, 42, 2]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#398-400)#### pub unsafe fn get\_unchecked<I>( &self, index: I) -> &<I as SliceIndex<[T]>>::Outputwhere I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, Returns a reference to an element or subslice, without doing bounds checking. For a safe alternative see [`get`](../primitive.slice#method.get). ##### Safety Calling this method with an out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. ##### Examples ``` let x = &[1, 2, 4]; unsafe { assert_eq!(x.get_unchecked(1), &2); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#436-438)#### pub unsafe fn get\_unchecked\_mut<I>( &mut self, index: I) -> &mut <I as SliceIndex<[T]>>::Outputwhere I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, Returns a mutable reference to an element or subslice, without doing bounds checking. For a safe alternative see [`get_mut`](../primitive.slice#method.get_mut). ##### Safety Calling this method with an out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. ##### Examples ``` let x = &mut [1, 2, 4]; unsafe { let elem = x.get_unchecked_mut(1); *elem = 13; } assert_eq!(x, &[1, 13, 4]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#476)#### pub fn as\_ptr(&self) -> \*const T Returns a raw pointer to the slice’s buffer. The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage. The caller must also ensure that the memory the pointer (non-transitively) points to is never written to (except inside an `UnsafeCell`) using this pointer or any pointer derived from it. If you need to mutate the contents of the slice, use [`as_mut_ptr`](../primitive.slice#method.as_mut_ptr). Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid. ##### Examples ``` let x = &[1, 2, 4]; let x_ptr = x.as_ptr(); unsafe { for i in 0..x.len() { assert_eq!(x.get_unchecked(i), &*x_ptr.add(i)); } } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#506)#### pub fn as\_mut\_ptr(&mut self) -> \*mut T Returns an unsafe mutable pointer to the slice’s buffer. The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage. Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid. ##### Examples ``` let x = &mut [1, 2, 4]; let x_ptr = x.as_mut_ptr(); unsafe { for i in 0..x.len() { *x_ptr.add(i) += 2; } } assert_eq!(x, &[3, 4, 6]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#542)1.48.0 · #### pub fn as\_ptr\_range(&self) -> Range<\*const T> Notable traits for [Range](../ops/struct.range "struct std::ops::Range")<A> ``` impl<A> Iterator for Range<A>where     A: Step, type Item = A; ``` Returns the two raw pointers spanning the slice. The returned range is half-open, which means that the end pointer points *one past* the last element of the slice. This way, an empty slice is represented by two equal pointers, and the difference between the two pointers represents the size of the slice. See [`as_ptr`](../primitive.slice#method.as_ptr) for warnings on using these pointers. The end pointer requires extra caution, as it does not point to a valid element in the slice. This function is useful for interacting with foreign interfaces which use two pointers to refer to a range of elements in memory, as is common in C++. It can also be useful to check if a pointer to an element refers to an element of this slice: ``` let a = [1, 2, 3]; let x = &a[1] as *const _; let y = &5 as *const _; assert!(a.as_ptr_range().contains(&x)); assert!(!a.as_ptr_range().contains(&y)); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#586)1.48.0 · #### pub fn as\_mut\_ptr\_range(&mut self) -> Range<\*mut T> Notable traits for [Range](../ops/struct.range "struct std::ops::Range")<A> ``` impl<A> Iterator for Range<A>where     A: Step, type Item = A; ``` Returns the two unsafe mutable pointers spanning the slice. The returned range is half-open, which means that the end pointer points *one past* the last element of the slice. This way, an empty slice is represented by two equal pointers, and the difference between the two pointers represents the size of the slice. See [`as_mut_ptr`](../primitive.slice#method.as_mut_ptr) for warnings on using these pointers. The end pointer requires extra caution, as it does not point to a valid element in the slice. This function is useful for interacting with foreign interfaces which use two pointers to refer to a range of elements in memory, as is common in C++. [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#615)#### pub fn swap(&mut self, a: usize, b: usize) Swaps two elements in the slice. ##### Arguments * a - The index of the first element * b - The index of the second element ##### Panics Panics if `a` or `b` are out of bounds. ##### Examples ``` let mut v = ["a", "b", "c", "d", "e"]; v.swap(2, 4); assert!(v == ["a", "b", "e", "d", "c"]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#658)#### pub unsafe fn swap\_unchecked(&mut self, a: usize, b: usize) 🔬This is a nightly-only experimental API. (`slice_swap_unchecked` [#88539](https://github.com/rust-lang/rust/issues/88539)) Swaps two elements in the slice, without doing bounds checking. For a safe alternative see [`swap`](../primitive.slice#method.swap). ##### Arguments * a - The index of the first element * b - The index of the second element ##### Safety Calling this method with an out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)*. The caller has to ensure that `a < self.len()` and `b < self.len()`. ##### Examples ``` #![feature(slice_swap_unchecked)] let mut v = ["a", "b", "c", "d"]; // SAFETY: we know that 1 and 3 are both indices of the slice unsafe { v.swap_unchecked(1, 3) }; assert!(v == ["a", "d", "c", "b"]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#680)#### pub fn reverse(&mut self) Reverses the order of elements in the slice, in place. ##### Examples ``` let mut v = [1, 2, 3]; v.reverse(); assert!(v == [3, 2, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#738)#### pub fn iter(&self) -> Iter<'\_, T> Notable traits for [Iter](../slice/struct.iter "struct std::slice::Iter")<'a, T> ``` impl<'a, T> Iterator for Iter<'a, T> type Item = &'a T; ``` Returns an iterator over the slice. The iterator yields all items from start to end. ##### Examples ``` let x = &[1, 2, 4]; let mut iterator = x.iter(); assert_eq!(iterator.next(), Some(&1)); assert_eq!(iterator.next(), Some(&2)); assert_eq!(iterator.next(), Some(&4)); assert_eq!(iterator.next(), None); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#757)#### pub fn iter\_mut(&mut self) -> IterMut<'\_, T> Notable traits for [IterMut](../slice/struct.itermut "struct std::slice::IterMut")<'a, T> ``` impl<'a, T> Iterator for IterMut<'a, T> type Item = &'a mut T; ``` Returns an iterator that allows modifying each value. The iterator yields all items from start to end. ##### Examples ``` let x = &mut [1, 2, 4]; for elem in x.iter_mut() { *elem += 2; } assert_eq!(x, &[3, 4, 6]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#789)#### pub fn windows(&self, size: usize) -> Windows<'\_, T> Notable traits for [Windows](../slice/struct.windows "struct std::slice::Windows")<'a, T> ``` impl<'a, T> Iterator for Windows<'a, T> type Item = &'a [T]; ``` Returns an iterator over all contiguous windows of length `size`. The windows overlap. If the slice is shorter than `size`, the iterator returns no values. ##### Panics Panics if `size` is 0. ##### Examples ``` let slice = ['r', 'u', 's', 't']; let mut iter = slice.windows(2); assert_eq!(iter.next().unwrap(), &['r', 'u']); assert_eq!(iter.next().unwrap(), &['u', 's']); assert_eq!(iter.next().unwrap(), &['s', 't']); assert!(iter.next().is_none()); ``` If the slice is shorter than `size`: ``` let slice = ['f', 'o', 'o']; let mut iter = slice.windows(4); assert!(iter.next().is_none()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#823)#### pub fn chunks(&self, chunk\_size: usize) -> Chunks<'\_, T> Notable traits for [Chunks](../slice/struct.chunks "struct std::slice::Chunks")<'a, T> ``` impl<'a, T> Iterator for Chunks<'a, T> type Item = &'a [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the beginning of the slice. The chunks are slices and do not overlap. If `chunk_size` does not divide the length of the slice, then the last chunk will not have length `chunk_size`. See [`chunks_exact`](../primitive.slice#method.chunks_exact) for a variant of this iterator that returns chunks of always exactly `chunk_size` elements, and [`rchunks`](../primitive.slice#method.rchunks) for the same iterator but starting at the end of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let slice = ['l', 'o', 'r', 'e', 'm']; let mut iter = slice.chunks(2); assert_eq!(iter.next().unwrap(), &['l', 'o']); assert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#861)#### pub fn chunks\_mut(&mut self, chunk\_size: usize) -> ChunksMut<'\_, T> Notable traits for [ChunksMut](../slice/struct.chunksmut "struct std::slice::ChunksMut")<'a, T> ``` impl<'a, T> Iterator for ChunksMut<'a, T> type Item = &'a mut [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the beginning of the slice. The chunks are mutable slices, and do not overlap. If `chunk_size` does not divide the length of the slice, then the last chunk will not have length `chunk_size`. See [`chunks_exact_mut`](../primitive.slice#method.chunks_exact_mut) for a variant of this iterator that returns chunks of always exactly `chunk_size` elements, and [`rchunks_mut`](../primitive.slice#method.rchunks_mut) for the same iterator but starting at the end of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; for chunk in v.chunks_mut(2) { for elem in chunk.iter_mut() { *elem += count; } count += 1; } assert_eq!(v, &[1, 1, 2, 2, 3]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#898)1.31.0 · #### pub fn chunks\_exact(&self, chunk\_size: usize) -> ChunksExact<'\_, T> Notable traits for [ChunksExact](../slice/struct.chunksexact "struct std::slice::ChunksExact")<'a, T> ``` impl<'a, T> Iterator for ChunksExact<'a, T> type Item = &'a [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the beginning of the slice. The chunks are slices and do not overlap. If `chunk_size` does not divide the length of the slice, then the last up to `chunk_size-1` elements will be omitted and can be retrieved from the `remainder` function of the iterator. Due to each chunk having exactly `chunk_size` elements, the compiler can often optimize the resulting code better than in the case of [`chunks`](../primitive.slice#method.chunks). See [`chunks`](../primitive.slice#method.chunks) for a variant of this iterator that also returns the remainder as a smaller chunk, and [`rchunks_exact`](../primitive.slice#method.rchunks_exact) for the same iterator but starting at the end of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let slice = ['l', 'o', 'r', 'e', 'm']; let mut iter = slice.chunks_exact(2); assert_eq!(iter.next().unwrap(), &['l', 'o']); assert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#940)1.31.0 · #### pub fn chunks\_exact\_mut(&mut self, chunk\_size: usize) -> ChunksExactMut<'\_, T> Notable traits for [ChunksExactMut](../slice/struct.chunksexactmut "struct std::slice::ChunksExactMut")<'a, T> ``` impl<'a, T> Iterator for ChunksExactMut<'a, T> type Item = &'a mut [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the beginning of the slice. The chunks are mutable slices, and do not overlap. If `chunk_size` does not divide the length of the slice, then the last up to `chunk_size-1` elements will be omitted and can be retrieved from the `into_remainder` function of the iterator. Due to each chunk having exactly `chunk_size` elements, the compiler can often optimize the resulting code better than in the case of [`chunks_mut`](../primitive.slice#method.chunks_mut). See [`chunks_mut`](../primitive.slice#method.chunks_mut) for a variant of this iterator that also returns the remainder as a smaller chunk, and [`rchunks_exact_mut`](../primitive.slice#method.rchunks_exact_mut) for the same iterator but starting at the end of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; for chunk in v.chunks_exact_mut(2) { for elem in chunk.iter_mut() { *elem += count; } count += 1; } assert_eq!(v, &[1, 1, 2, 2, 0]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#975)#### pub unsafe fn as\_chunks\_unchecked<const N: usize>(&self) -> &[[T; N]] 🔬This is a nightly-only experimental API. (`slice_as_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Splits the slice into a slice of `N`-element arrays, assuming that there’s no remainder. ##### Safety This may only be called when * The slice splits exactly into `N`-element chunks (aka `self.len() % N == 0`). * `N != 0`. ##### Examples ``` #![feature(slice_as_chunks)] let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!']; let chunks: &[[char; 1]] = // SAFETY: 1-element chunks never have remainder unsafe { slice.as_chunks_unchecked() }; assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]); let chunks: &[[char; 3]] = // SAFETY: The slice length (6) is a multiple of 3 unsafe { slice.as_chunks_unchecked() }; assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]); // These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1008)#### pub fn as\_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]) 🔬This is a nightly-only experimental API. (`slice_as_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Splits the slice into a slice of `N`-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than `N`. ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(slice_as_chunks)] let slice = ['l', 'o', 'r', 'e', 'm']; let (chunks, remainder) = slice.as_chunks(); assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]); assert_eq!(remainder, &['m']); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1039)#### pub fn as\_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]) 🔬This is a nightly-only experimental API. (`slice_as_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Splits the slice into a slice of `N`-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than `N`. ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(slice_as_chunks)] let slice = ['l', 'o', 'r', 'e', 'm']; let (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1078)#### pub fn array\_chunks<const N: usize>(&self) -> ArrayChunks<'\_, T, N> Notable traits for [ArrayChunks](../slice/struct.arraychunks "struct std::slice::ArrayChunks")<'a, T, N> ``` impl<'a, T, const N: usize> Iterator for ArrayChunks<'a, T, N> type Item = &'a [T; N]; ``` 🔬This is a nightly-only experimental API. (`array_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Returns an iterator over `N` elements of the slice at a time, starting at the beginning of the slice. The chunks are array references and do not overlap. If `N` does not divide the length of the slice, then the last up to `N-1` elements will be omitted and can be retrieved from the `remainder` function of the iterator. This method is the const generic equivalent of [`chunks_exact`](../primitive.slice#method.chunks_exact). ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(array_chunks)] let slice = ['l', 'o', 'r', 'e', 'm']; let mut iter = slice.array_chunks(); assert_eq!(iter.next().unwrap(), &['l', 'o']); assert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1115)#### pub unsafe fn as\_chunks\_unchecked\_mut<const N: usize>( &mut self) -> &mut [[T; N]] 🔬This is a nightly-only experimental API. (`slice_as_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Splits the slice into a slice of `N`-element arrays, assuming that there’s no remainder. ##### Safety This may only be called when * The slice splits exactly into `N`-element chunks (aka `self.len() % N == 0`). * `N != 0`. ##### Examples ``` #![feature(slice_as_chunks)] let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!']; let chunks: &mut [[char; 1]] = // SAFETY: 1-element chunks never have remainder unsafe { slice.as_chunks_unchecked_mut() }; chunks[0] = ['L']; assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]); let chunks: &mut [[char; 3]] = // SAFETY: The slice length (6) is a multiple of 3 unsafe { slice.as_chunks_unchecked_mut() }; chunks[1] = ['a', 'x', '?']; assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']); // These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1154)#### pub fn as\_chunks\_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]) 🔬This is a nightly-only experimental API. (`slice_as_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Splits the slice into a slice of `N`-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than `N`. ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(slice_as_chunks)] let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; let (chunks, remainder) = v.as_chunks_mut(); remainder[0] = 9; for chunk in chunks { *chunk = [count; 2]; count += 1; } assert_eq!(v, &[1, 1, 2, 2, 9]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1191)#### pub fn as\_rchunks\_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]) 🔬This is a nightly-only experimental API. (`slice_as_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Splits the slice into a slice of `N`-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than `N`. ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(slice_as_chunks)] let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; let (remainder, chunks) = v.as_rchunks_mut(); remainder[0] = 9; for chunk in chunks { *chunk = [count; 2]; count += 1; } assert_eq!(v, &[9, 1, 1, 2, 2]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1232)#### pub fn array\_chunks\_mut<const N: usize>(&mut self) -> ArrayChunksMut<'\_, T, N> Notable traits for [ArrayChunksMut](../slice/struct.arraychunksmut "struct std::slice::ArrayChunksMut")<'a, T, N> ``` impl<'a, T, const N: usize> Iterator for ArrayChunksMut<'a, T, N> type Item = &'a mut [T; N]; ``` 🔬This is a nightly-only experimental API. (`array_chunks` [#74985](https://github.com/rust-lang/rust/issues/74985)) Returns an iterator over `N` elements of the slice at a time, starting at the beginning of the slice. The chunks are mutable array references and do not overlap. If `N` does not divide the length of the slice, then the last up to `N-1` elements will be omitted and can be retrieved from the `into_remainder` function of the iterator. This method is the const generic equivalent of [`chunks_exact_mut`](../primitive.slice#method.chunks_exact_mut). ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(array_chunks)] let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; for chunk in v.array_chunks_mut() { *chunk = [count; 2]; count += 1; } assert_eq!(v, &[1, 1, 2, 2, 0]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1264)#### pub fn array\_windows<const N: usize>(&self) -> ArrayWindows<'\_, T, N> Notable traits for [ArrayWindows](../slice/struct.arraywindows "struct std::slice::ArrayWindows")<'a, T, N> ``` impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N> type Item = &'a [T; N]; ``` 🔬This is a nightly-only experimental API. (`array_windows` [#75027](https://github.com/rust-lang/rust/issues/75027)) Returns an iterator over overlapping windows of `N` elements of a slice, starting at the beginning of the slice. This is the const generic equivalent of [`windows`](../primitive.slice#method.windows). If `N` is greater than the size of the slice, it will return no windows. ##### Panics Panics if `N` is 0. This check will most probably get changed to a compile time error before this method gets stabilized. ##### Examples ``` #![feature(array_windows)] let slice = [0, 1, 2, 3]; let mut iter = slice.array_windows(); assert_eq!(iter.next().unwrap(), &[0, 1]); assert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1298)1.31.0 · #### pub fn rchunks(&self, chunk\_size: usize) -> RChunks<'\_, T> Notable traits for [RChunks](../slice/struct.rchunks "struct std::slice::RChunks")<'a, T> ``` impl<'a, T> Iterator for RChunks<'a, T> type Item = &'a [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the end of the slice. The chunks are slices and do not overlap. If `chunk_size` does not divide the length of the slice, then the last chunk will not have length `chunk_size`. See [`rchunks_exact`](../primitive.slice#method.rchunks_exact) for a variant of this iterator that returns chunks of always exactly `chunk_size` elements, and [`chunks`](../primitive.slice#method.chunks) for the same iterator but starting at the beginning of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let slice = ['l', 'o', 'r', 'e', 'm']; let mut iter = slice.rchunks(2); assert_eq!(iter.next().unwrap(), &['e', 'm']); assert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1336)1.31.0 · #### pub fn rchunks\_mut(&mut self, chunk\_size: usize) -> RChunksMut<'\_, T> Notable traits for [RChunksMut](../slice/struct.rchunksmut "struct std::slice::RChunksMut")<'a, T> ``` impl<'a, T> Iterator for RChunksMut<'a, T> type Item = &'a mut [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the end of the slice. The chunks are mutable slices, and do not overlap. If `chunk_size` does not divide the length of the slice, then the last chunk will not have length `chunk_size`. See [`rchunks_exact_mut`](../primitive.slice#method.rchunks_exact_mut) for a variant of this iterator that returns chunks of always exactly `chunk_size` elements, and [`chunks_mut`](../primitive.slice#method.chunks_mut) for the same iterator but starting at the beginning of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; for chunk in v.rchunks_mut(2) { for elem in chunk.iter_mut() { *elem += count; } count += 1; } assert_eq!(v, &[3, 2, 2, 1, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1375)1.31.0 · #### pub fn rchunks\_exact(&self, chunk\_size: usize) -> RChunksExact<'\_, T> Notable traits for [RChunksExact](../slice/struct.rchunksexact "struct std::slice::RChunksExact")<'a, T> ``` impl<'a, T> Iterator for RChunksExact<'a, T> type Item = &'a [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the end of the slice. The chunks are slices and do not overlap. If `chunk_size` does not divide the length of the slice, then the last up to `chunk_size-1` elements will be omitted and can be retrieved from the `remainder` function of the iterator. Due to each chunk having exactly `chunk_size` elements, the compiler can often optimize the resulting code better than in the case of [`rchunks`](../primitive.slice#method.rchunks). See [`rchunks`](../primitive.slice#method.rchunks) for a variant of this iterator that also returns the remainder as a smaller chunk, and [`chunks_exact`](../primitive.slice#method.chunks_exact) for the same iterator but starting at the beginning of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let slice = ['l', 'o', 'r', 'e', 'm']; let mut iter = slice.rchunks_exact(2); assert_eq!(iter.next().unwrap(), &['e', 'm']); assert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1418)1.31.0 · #### pub fn rchunks\_exact\_mut(&mut self, chunk\_size: usize) -> RChunksExactMut<'\_, T> Notable traits for [RChunksExactMut](../slice/struct.rchunksexactmut "struct std::slice::RChunksExactMut")<'a, T> ``` impl<'a, T> Iterator for RChunksExactMut<'a, T> type Item = &'a mut [T]; ``` Returns an iterator over `chunk_size` elements of the slice at a time, starting at the end of the slice. The chunks are mutable slices, and do not overlap. If `chunk_size` does not divide the length of the slice, then the last up to `chunk_size-1` elements will be omitted and can be retrieved from the `into_remainder` function of the iterator. Due to each chunk having exactly `chunk_size` elements, the compiler can often optimize the resulting code better than in the case of [`chunks_mut`](../primitive.slice#method.chunks_mut). See [`rchunks_mut`](../primitive.slice#method.rchunks_mut) for a variant of this iterator that also returns the remainder as a smaller chunk, and [`chunks_exact_mut`](../primitive.slice#method.chunks_exact_mut) for the same iterator but starting at the beginning of the slice. ##### Panics Panics if `chunk_size` is 0. ##### Examples ``` let v = &mut [0, 0, 0, 0, 0]; let mut count = 1; for chunk in v.rchunks_exact_mut(2) { for elem in chunk.iter_mut() { *elem += count; } count += 1; } assert_eq!(v, &[0, 2, 2, 1, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1461-1463)#### pub fn group\_by<F>(&self, pred: F) -> GroupBy<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [GroupBy](../slice/struct.groupby "struct std::slice::GroupBy")<'a, T, P> ``` impl<'a, T, P> Iterator for GroupBy<'a, T, P>where     T: 'a,     P: FnMut(&T, &T) -> bool, type Item = &'a [T]; ``` 🔬This is a nightly-only experimental API. (`slice_group_by` [#80552](https://github.com/rust-lang/rust/issues/80552)) Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them. The predicate is called on two elements following themselves, it means the predicate is called on `slice[0]` and `slice[1]` then on `slice[1]` and `slice[2]` and so on. ##### Examples ``` #![feature(slice_group_by)] let slice = &[1, 1, 1, 3, 3, 2, 2, 2]; let mut iter = slice.group_by(|a, b| a == b); assert_eq!(iter.next(), Some(&[1, 1, 1][..])); assert_eq!(iter.next(), Some(&[3, 3][..])); assert_eq!(iter.next(), Some(&[2, 2, 2][..])); assert_eq!(iter.next(), None); ``` This method can be used to extract the sorted subslices: ``` #![feature(slice_group_by)] let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4]; let mut iter = slice.group_by(|a, b| a <= b); assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1506-1508)#### pub fn group\_by\_mut<F>(&mut self, pred: F) -> GroupByMut<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [GroupByMut](../slice/struct.groupbymut "struct std::slice::GroupByMut")<'a, T, P> ``` impl<'a, T, P> Iterator for GroupByMut<'a, T, P>where     T: 'a,     P: FnMut(&T, &T) -> bool, type Item = &'a mut [T]; ``` 🔬This is a nightly-only experimental API. (`slice_group_by` [#80552](https://github.com/rust-lang/rust/issues/80552)) Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them. The predicate is called on two elements following themselves, it means the predicate is called on `slice[0]` and `slice[1]` then on `slice[1]` and `slice[2]` and so on. ##### Examples ``` #![feature(slice_group_by)] let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2]; let mut iter = slice.group_by_mut(|a, b| a == b); assert_eq!(iter.next(), Some(&mut [1, 1, 1][..])); assert_eq!(iter.next(), Some(&mut [3, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 2, 2][..])); assert_eq!(iter.next(), None); ``` This method can be used to extract the sorted subslices: ``` #![feature(slice_group_by)] let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4]; let mut iter = slice.group_by_mut(|a, b| a <= b); assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1551)#### pub fn split\_at(&self, mid: usize) -> (&[T], &[T]) Divides one slice into two at an index. The first will contain all indices from `[0, mid)` (excluding the index `mid` itself) and the second will contain all indices from `[mid, len)` (excluding the index `len` itself). ##### Panics Panics if `mid > len`. ##### Examples ``` let v = [1, 2, 3, 4, 5, 6]; { let (left, right) = v.split_at(0); assert_eq!(left, []); assert_eq!(right, [1, 2, 3, 4, 5, 6]); } { let (left, right) = v.split_at(2); assert_eq!(left, [1, 2]); assert_eq!(right, [3, 4, 5, 6]); } { let (left, right) = v.split_at(6); assert_eq!(left, [1, 2, 3, 4, 5, 6]); assert_eq!(right, []); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1583)#### pub fn split\_at\_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) Divides one mutable slice into two at an index. The first will contain all indices from `[0, mid)` (excluding the index `mid` itself) and the second will contain all indices from `[mid, len)` (excluding the index `len` itself). ##### Panics Panics if `mid > len`. ##### Examples ``` let mut v = [1, 0, 3, 0, 5, 6]; let (left, right) = v.split_at_mut(2); assert_eq!(left, [1, 0]); assert_eq!(right, [3, 0, 5, 6]); left[1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1636)#### pub unsafe fn split\_at\_unchecked(&self, mid: usize) -> (&[T], &[T]) 🔬This is a nightly-only experimental API. (`slice_split_at_unchecked` [#76014](https://github.com/rust-lang/rust/issues/76014)) Divides one slice into two at an index, without doing bounds checking. The first will contain all indices from `[0, mid)` (excluding the index `mid` itself) and the second will contain all indices from `[mid, len)` (excluding the index `len` itself). For a safe alternative see [`split_at`](../primitive.slice#method.split_at). ##### Safety Calling this method with an out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. The caller has to ensure that `0 <= mid <= self.len()`. ##### Examples ``` #![feature(slice_split_at_unchecked)] let v = [1, 2, 3, 4, 5, 6]; unsafe { let (left, right) = v.split_at_unchecked(0); assert_eq!(left, []); assert_eq!(right, [1, 2, 3, 4, 5, 6]); } unsafe { let (left, right) = v.split_at_unchecked(2); assert_eq!(left, [1, 2]); assert_eq!(right, [3, 4, 5, 6]); } unsafe { let (left, right) = v.split_at_unchecked(6); assert_eq!(left, [1, 2, 3, 4, 5, 6]); assert_eq!(right, []); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1684)#### pub unsafe fn split\_at\_mut\_unchecked( &mut self, mid: usize) -> (&mut [T], &mut [T]) 🔬This is a nightly-only experimental API. (`slice_split_at_unchecked` [#76014](https://github.com/rust-lang/rust/issues/76014)) Divides one mutable slice into two at an index, without doing bounds checking. The first will contain all indices from `[0, mid)` (excluding the index `mid` itself) and the second will contain all indices from `[mid, len)` (excluding the index `len` itself). For a safe alternative see [`split_at_mut`](../primitive.slice#method.split_at_mut). ##### Safety Calling this method with an out-of-bounds index is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. The caller has to ensure that `0 <= mid <= self.len()`. ##### Examples ``` #![feature(slice_split_at_unchecked)] let mut v = [1, 0, 3, 0, 5, 6]; // scoped to restrict the lifetime of the borrows unsafe { let (left, right) = v.split_at_mut_unchecked(2); assert_eq!(left, [1, 0]); assert_eq!(right, [3, 0, 5, 6]); left[1] = 2; right[1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1737)#### pub fn split\_array\_ref<const N: usize>(&self) -> (&[T; N], &[T]) 🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091)) Divides one slice into an array and a remainder slice at an index. The array will contain all indices from `[0, N)` (excluding the index `N` itself) and the slice will contain all indices from `[N, len)` (excluding the index `len` itself). ##### Panics Panics if `N > len`. ##### Examples ``` #![feature(split_array)] let v = &[1, 2, 3, 4, 5, 6][..]; { let (left, right) = v.split_array_ref::<0>(); assert_eq!(left, &[]); assert_eq!(right, [1, 2, 3, 4, 5, 6]); } { let (left, right) = v.split_array_ref::<2>(); assert_eq!(left, &[1, 2]); assert_eq!(right, [3, 4, 5, 6]); } { let (left, right) = v.split_array_ref::<6>(); assert_eq!(left, &[1, 2, 3, 4, 5, 6]); assert_eq!(right, []); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1770)#### pub fn split\_array\_mut<const N: usize>(&mut self) -> (&mut [T; N], &mut [T]) 🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091)) Divides one mutable slice into an array and a remainder slice at an index. The array will contain all indices from `[0, N)` (excluding the index `N` itself) and the slice will contain all indices from `[N, len)` (excluding the index `len` itself). ##### Panics Panics if `N > len`. ##### Examples ``` #![feature(split_array)] let mut v = &mut [1, 0, 3, 0, 5, 6][..]; let (left, right) = v.split_array_mut::<2>(); assert_eq!(left, &mut [1, 0]); assert_eq!(right, [3, 0, 5, 6]); left[1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1815)#### pub fn rsplit\_array\_ref<const N: usize>(&self) -> (&[T], &[T; N]) 🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091)) Divides one slice into an array and a remainder slice at an index from the end. The slice will contain all indices from `[0, len - N)` (excluding the index `len - N` itself) and the array will contain all indices from `[len - N, len)` (excluding the index `len` itself). ##### Panics Panics if `N > len`. ##### Examples ``` #![feature(split_array)] let v = &[1, 2, 3, 4, 5, 6][..]; { let (left, right) = v.rsplit_array_ref::<0>(); assert_eq!(left, [1, 2, 3, 4, 5, 6]); assert_eq!(right, &[]); } { let (left, right) = v.rsplit_array_ref::<2>(); assert_eq!(left, [1, 2, 3, 4]); assert_eq!(right, &[5, 6]); } { let (left, right) = v.rsplit_array_ref::<6>(); assert_eq!(left, []); assert_eq!(right, &[1, 2, 3, 4, 5, 6]); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1849)#### pub fn rsplit\_array\_mut<const N: usize>(&mut self) -> (&mut [T], &mut [T; N]) 🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091)) Divides one mutable slice into an array and a remainder slice at an index from the end. The slice will contain all indices from `[0, len - N)` (excluding the index `N` itself) and the array will contain all indices from `[len - N, len)` (excluding the index `len` itself). ##### Panics Panics if `N > len`. ##### Examples ``` #![feature(split_array)] let mut v = &mut [1, 0, 3, 0, 5, 6][..]; let (left, right) = v.rsplit_array_mut::<4>(); assert_eq!(left, [1, 0]); assert_eq!(right, &mut [3, 0, 5, 6]); left[1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1898-1900)#### pub fn split<F>(&self, pred: F) -> Split<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [Split](../slice/struct.split "struct std::slice::Split")<'a, T, P> ``` impl<'a, T, P> Iterator for Split<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a [T]; ``` Returns an iterator over subslices separated by elements that match `pred`. The matched element is not contained in the subslices. ##### Examples ``` let slice = [10, 40, 33, 20]; let mut iter = slice.split(|num| num % 3 == 0); assert_eq!(iter.next().unwrap(), &[10, 40]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none()); ``` If the first element is matched, an empty slice will be the first item returned by the iterator. Similarly, if the last element in the slice is matched, an empty slice will be the last item returned by the iterator: ``` let slice = [10, 40, 33]; let mut iter = slice.split(|num| num % 3 == 0); assert_eq!(iter.next().unwrap(), &[10, 40]); assert_eq!(iter.next().unwrap(), &[]); assert!(iter.next().is_none()); ``` If two matched elements are directly adjacent, an empty slice will be present between them: ``` let slice = [10, 6, 33, 20]; let mut iter = slice.split(|num| num % 3 == 0); assert_eq!(iter.next().unwrap(), &[10]); assert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1920-1922)#### pub fn split\_mut<F>(&mut self, pred: F) -> SplitMut<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [SplitMut](../slice/struct.splitmut "struct std::slice::SplitMut")<'a, T, P> ``` impl<'a, T, P> Iterator for SplitMut<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a mut [T]; ``` Returns an iterator over mutable subslices separated by elements that match `pred`. The matched element is not contained in the subslices. ##### Examples ``` let mut v = [10, 40, 30, 20, 60, 50]; for group in v.split_mut(|num| *num % 3 == 0) { group[0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1956-1958)1.51.0 · #### pub fn split\_inclusive<F>(&self, pred: F) -> SplitInclusive<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [SplitInclusive](../slice/struct.splitinclusive "struct std::slice::SplitInclusive")<'a, T, P> ``` impl<'a, T, P> Iterator for SplitInclusive<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a [T]; ``` Returns an iterator over subslices separated by elements that match `pred`. The matched element is contained in the end of the previous subslice as a terminator. ##### Examples ``` let slice = [10, 40, 33, 20]; let mut iter = slice.split_inclusive(|num| num % 3 == 0); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none()); ``` If the last element of the slice is matched, that element will be considered the terminator of the preceding slice. That slice will be the last item returned by the iterator. ``` let slice = [3, 10, 40, 33]; let mut iter = slice.split_inclusive(|num| num % 3 == 0); assert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#1980-1982)1.51.0 · #### pub fn split\_inclusive\_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [SplitInclusiveMut](../slice/struct.splitinclusivemut "struct std::slice::SplitInclusiveMut")<'a, T, P> ``` impl<'a, T, P> Iterator for SplitInclusiveMut<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a mut [T]; ``` Returns an iterator over mutable subslices separated by elements that match `pred`. The matched element is contained in the previous subslice as a terminator. ##### Examples ``` let mut v = [10, 40, 30, 20, 60, 50]; for group in v.split_inclusive_mut(|num| *num % 3 == 0) { let terminator_idx = group.len()-1; group[terminator_idx] = 1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2016-2018)1.27.0 · #### pub fn rsplit<F>(&self, pred: F) -> RSplit<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [RSplit](../slice/struct.rsplit "struct std::slice::RSplit")<'a, T, P> ``` impl<'a, T, P> Iterator for RSplit<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a [T]; ``` Returns an iterator over subslices separated by elements that match `pred`, starting at the end of the slice and working backwards. The matched element is not contained in the subslices. ##### Examples ``` let slice = [11, 22, 33, 0, 44, 55]; let mut iter = slice.rsplit(|num| *num == 0); assert_eq!(iter.next().unwrap(), &[44, 55]); assert_eq!(iter.next().unwrap(), &[11, 22, 33]); assert_eq!(iter.next(), None); ``` As with `split()`, if the first or last element is matched, an empty slice will be the first (or last) item returned by the iterator. ``` let v = &[0, 1, 1, 2, 3, 5, 8]; let mut it = v.rsplit(|n| *n % 2 == 0); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next().unwrap(), &[3, 5]); assert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2042-2044)1.27.0 · #### pub fn rsplit\_mut<F>(&mut self, pred: F) -> RSplitMut<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [RSplitMut](../slice/struct.rsplitmut "struct std::slice::RSplitMut")<'a, T, P> ``` impl<'a, T, P> Iterator for RSplitMut<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a mut [T]; ``` Returns an iterator over mutable subslices separated by elements that match `pred`, starting at the end of the slice and working backwards. The matched element is not contained in the subslices. ##### Examples ``` let mut v = [100, 400, 300, 200, 600, 500]; let mut count = 0; for group in v.rsplit_mut(|num| *num % 3 == 0) { count += 1; group[0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2070-2072)#### pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [SplitN](../slice/struct.splitn "struct std::slice::SplitN")<'a, T, P> ``` impl<'a, T, P> Iterator for SplitN<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a [T]; ``` Returns an iterator over subslices separated by elements that match `pred`, limited to returning at most `n` items. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice. ##### Examples Print the slice split once by numbers divisible by 3 (i.e., `[10, 40]`, `[20, 60, 50]`): ``` let v = [10, 40, 30, 20, 60, 50]; for group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2096-2098)#### pub fn splitn\_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [SplitNMut](../slice/struct.splitnmut "struct std::slice::SplitNMut")<'a, T, P> ``` impl<'a, T, P> Iterator for SplitNMut<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a mut [T]; ``` Returns an iterator over subslices separated by elements that match `pred`, limited to returning at most `n` items. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice. ##### Examples ``` let mut v = [10, 40, 30, 20, 60, 50]; for group in v.splitn_mut(2, |num| *num % 3 == 0) { group[0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2125-2127)#### pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [RSplitN](../slice/struct.rsplitn "struct std::slice::RSplitN")<'a, T, P> ``` impl<'a, T, P> Iterator for RSplitN<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a [T]; ``` Returns an iterator over subslices separated by elements that match `pred` limited to returning at most `n` items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice. ##### Examples Print the slice split once, starting from the end, by numbers divisible by 3 (i.e., `[50]`, `[10, 40, 30, 20]`): ``` let v = [10, 40, 30, 20, 60, 50]; for group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2152-2154)#### pub fn rsplitn\_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Notable traits for [RSplitNMut](../slice/struct.rsplitnmut "struct std::slice::RSplitNMut")<'a, T, P> ``` impl<'a, T, P> Iterator for RSplitNMut<'a, T, P>where     P: FnMut(&T) -> bool, type Item = &'a mut [T]; ``` Returns an iterator over subslices separated by elements that match `pred` limited to returning at most `n` items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice. ##### Examples ``` let mut s = [10, 40, 30, 20, 60, 50]; for group in s.rsplitn_mut(2, |num| *num % 3 == 0) { group[0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2187-2189)#### pub fn contains(&self, x: &T) -> boolwhere T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, Returns `true` if the slice contains an element with the given value. This operation is *O*(*n*). Note that if you have a sorted slice, [`binary_search`](../primitive.slice#method.binary_search) may be faster. ##### Examples ``` let v = [10, 40, 30]; assert!(v.contains(&30)); assert!(!v.contains(&50)); ``` If you do not have a `&T`, but some other value that you can compare with one (for example, `String` implements `PartialEq<str>`), you can use `iter().any`: ``` let v = [String::from("hello"), String::from("world")]; // slice of `String` assert!(v.iter().any(|e| e == "hello")); // search with `&str` assert!(!v.iter().any(|e| e == "hi")); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2216-2218)#### pub fn starts\_with(&self, needle: &[T]) -> boolwhere T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, Returns `true` if `needle` is a prefix of the slice. ##### Examples ``` let v = [10, 40, 30]; assert!(v.starts_with(&[10])); assert!(v.starts_with(&[10, 40])); assert!(!v.starts_with(&[50])); assert!(!v.starts_with(&[10, 50])); ``` Always returns `true` if `needle` is an empty slice: ``` let v = &[10, 40, 30]; assert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[])); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2246-2248)#### pub fn ends\_with(&self, needle: &[T]) -> boolwhere T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, Returns `true` if `needle` is a suffix of the slice. ##### Examples ``` let v = [10, 40, 30]; assert!(v.ends_with(&[30])); assert!(v.ends_with(&[40, 30])); assert!(!v.ends_with(&[50])); assert!(!v.ends_with(&[50, 30])); ``` Always returns `true` if `needle` is an empty slice: ``` let v = &[10, 40, 30]; assert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[])); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2276-2278)1.51.0 · #### pub fn strip\_prefix<P>(&self, prefix: &P) -> Option<&[T]>where P: [SlicePattern](https://doc.rust-lang.org/core/slice/trait.SlicePattern.html "trait core::slice::SlicePattern")<Item = T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, Returns a subslice with the prefix removed. If the slice starts with `prefix`, returns the subslice after the prefix, wrapped in `Some`. If `prefix` is empty, simply returns the original slice. If the slice does not start with `prefix`, returns `None`. ##### Examples ``` let v = &[10, 40, 30]; assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..])); assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..])); assert_eq!(v.strip_prefix(&[50]), None); assert_eq!(v.strip_prefix(&[10, 50]), None); let prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref())); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2310-2312)1.51.0 · #### pub fn strip\_suffix<P>(&self, suffix: &P) -> Option<&[T]>where P: [SlicePattern](https://doc.rust-lang.org/core/slice/trait.SlicePattern.html "trait core::slice::SlicePattern")<Item = T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, Returns a subslice with the suffix removed. If the slice ends with `suffix`, returns the subslice before the suffix, wrapped in `Some`. If `suffix` is empty, simply returns the original slice. If the slice does not end with `suffix`, returns `None`. ##### Examples ``` let v = &[10, 40, 30]; assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..])); assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2372-2374)#### pub fn binary\_search(&self, x: &T) -> Result<usize, usize>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Binary searches this slice for a given element. This behaves similarly to [`contains`](../primitive.slice#method.contains) if this slice is sorted. If the value is found then [`Result::Ok`](../result/enum.result#variant.Ok "Result::Ok") is returned, containing the index of the matching element. If there are multiple matches, then any one of the matches could be returned. The index is chosen deterministically, but is subject to change in future versions of Rust. If the value is not found then [`Result::Err`](../result/enum.result#variant.Err "Result::Err") is returned, containing the index where a matching element could be inserted while maintaining sorted order. See also [`binary_search_by`](../primitive.slice#method.binary_search_by), [`binary_search_by_key`](../primitive.slice#method.binary_search_by_key), and [`partition_point`](../primitive.slice#method.partition_point). ##### Examples Looks up a series of four elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in `[1, 4]`. ``` let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; assert_eq!(s.binary_search(&13), Ok(9)); assert_eq!(s.binary_search(&4), Err(7)); assert_eq!(s.binary_search(&100), Err(13)); let r = s.binary_search(&1); assert!(match r { Ok(1..=4) => true, _ => false, }); ``` If you want to insert an item to a sorted vector, while maintaining sort order, consider using [`partition_point`](../primitive.slice#method.partition_point): ``` let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; let num = 42; let idx = s.partition_point(|&x| x < num); // The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);` s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2423-2425)#### pub fn binary\_search\_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&'a](../primitive.reference) T) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Binary searches this slice with a comparator function. This behaves similarly to [`contains`](../primitive.slice#method.contains) if this slice is sorted. The comparator function should implement an order consistent with the sort order of the underlying slice, returning an order code that indicates whether its argument is `Less`, `Equal` or `Greater` the desired target. If the value is found then [`Result::Ok`](../result/enum.result#variant.Ok "Result::Ok") is returned, containing the index of the matching element. If there are multiple matches, then any one of the matches could be returned. The index is chosen deterministically, but is subject to change in future versions of Rust. If the value is not found then [`Result::Err`](../result/enum.result#variant.Err "Result::Err") is returned, containing the index where a matching element could be inserted while maintaining sorted order. See also [`binary_search`](../primitive.slice#method.binary_search), [`binary_search_by_key`](../primitive.slice#method.binary_search_by_key), and [`partition_point`](../primitive.slice#method.partition_point). ##### Examples Looks up a series of four elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in `[1, 4]`. ``` let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; let seek = 13; assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9)); let seek = 4; assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7)); let seek = 100; assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13)); let seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, }); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2503-2506)1.10.0 · #### pub fn binary\_search\_by\_key<'a, B, F>( &'a self, b: &B, f: F) -> Result<usize, usize>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&'a](../primitive.reference) T) -> B, B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Binary searches this slice with a key extraction function. This behaves similarly to [`contains`](../primitive.slice#method.contains) if this slice is sorted. Assumes that the slice is sorted by the key, for instance with [`sort_by_key`](../primitive.slice#method.sort_by_key) using the same key extraction function. If the value is found then [`Result::Ok`](../result/enum.result#variant.Ok "Result::Ok") is returned, containing the index of the matching element. If there are multiple matches, then any one of the matches could be returned. The index is chosen deterministically, but is subject to change in future versions of Rust. If the value is not found then [`Result::Err`](../result/enum.result#variant.Err "Result::Err") is returned, containing the index where a matching element could be inserted while maintaining sorted order. See also [`binary_search`](../primitive.slice#method.binary_search), [`binary_search_by`](../primitive.slice#method.binary_search_by), and [`partition_point`](../primitive.slice#method.partition_point). ##### Examples Looks up a series of four elements in a slice of pairs sorted by their second elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in `[1, 4]`. ``` let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1), (1, 2), (2, 3), (4, 5), (5, 8), (3, 13), (1, 21), (2, 34), (4, 55)]; assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b), Ok(9)); assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b), Err(7)); assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2539-2541)1.20.0 · #### pub fn sort\_unstable(&mut self)where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Sorts the slice, but might not preserve the order of equal elements. This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and *O*(*n* \* log(*n*)) worst-case. ##### Current implementation The current algorithm is based on [pattern-defeating quicksort](https://github.com/orlp/pdqsort) by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior. It is typically faster than stable sorting, except in a few special cases, e.g., when the slice consists of several concatenated sorted sequences. ##### Examples ``` let mut v = [-5, 4, 1, -3, 2]; v.sort_unstable(); assert!(v == [-5, -3, 1, 2, 4]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2594-2596)1.20.0 · #### pub fn sort\_unstable\_by<F>(&mut self, compare: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Sorts the slice with a comparator function, but might not preserve the order of equal elements. This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and *O*(*n* \* log(*n*)) worst-case. The comparator function must define a total ordering for the elements in the slice. If the ordering is not total, the order of the elements is unspecified. An order is a total order if it is (for all `a`, `b` and `c`): * total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true, and * transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`. For example, while [`f64`](../primitive.f64 "f64") doesn’t implement [`Ord`](../cmp/trait.ord "Ord") because `NaN != NaN`, we can use `partial_cmp` as our sort function when we know the slice doesn’t contain a `NaN`. ``` let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0]; floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap()); assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]); ``` ##### Current implementation The current algorithm is based on [pattern-defeating quicksort](https://github.com/orlp/pdqsort) by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior. It is typically faster than stable sorting, except in a few special cases, e.g., when the slice consists of several concatenated sorted sequences. ##### Examples ``` let mut v = [5, 4, 1, 3, 2]; v.sort_unstable_by(|a, b| a.cmp(b)); assert!(v == [1, 2, 3, 4, 5]); // reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert!(v == [5, 4, 3, 2, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2632-2635)1.20.0 · #### pub fn sort\_unstable\_by\_key<K, F>(&mut self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> K, K: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Sorts the slice with a key extraction function, but might not preserve the order of equal elements. This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and *O*(m \* *n* \* log(*n*)) worst-case, where the key function is *O*(*m*). ##### Current implementation The current algorithm is based on [pattern-defeating quicksort](https://github.com/orlp/pdqsort) by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior. Due to its key calling strategy, [`sort_unstable_by_key`](#method.sort_unstable_by_key) is likely to be slower than [`sort_by_cached_key`](#method.sort_by_cached_key) in cases where the key function is expensive. ##### Examples ``` let mut v = [-5i32, 4, 1, -3, 2]; v.sort_unstable_by_key(|k| k.abs()); assert!(v == [1, 2, -3, 4, -5]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2678-2680)1.49.0 · #### pub fn select\_nth\_unstable( &mut self, index: usize) -> (&mut [T], &mut T, &mut [T])where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Reorder the slice such that the element at `index` is at its final sorted position. This reordering has the additional property that any value at position `i < index` will be less than or equal to any value at a position `j > index`. Additionally, this reordering is unstable (i.e. any number of equal elements may end up at position `index`), in-place (i.e. does not allocate), and *O*(*n*) worst-case. This function is also/ known as “kth element” in other libraries. It returns a triplet of the following values: all elements less than the one at the given index, the value at the given index, and all elements greater than the one at the given index. ##### Current implementation The current algorithm is based on the quickselect portion of the same quicksort algorithm used for [`sort_unstable`](../primitive.slice#method.sort_unstable). ##### Panics Panics when `index >= len()`, meaning it always panics on empty slices. ##### Examples ``` let mut v = [-5i32, 4, 1, -3, 2]; // Find the median v.select_nth_unstable(2); // We are only guaranteed the slice will be one of the following, based on the way we sort // about the specified index. assert!(v == [-3, -5, 1, 2, 4] || v == [-5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2726-2732)1.49.0 · #### pub fn select\_nth\_unstable\_by<F>( &mut self, index: usize, compare: F) -> (&mut [T], &mut T, &mut [T])where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Reorder the slice with a comparator function such that the element at `index` is at its final sorted position. This reordering has the additional property that any value at position `i < index` will be less than or equal to any value at a position `j > index` using the comparator function. Additionally, this reordering is unstable (i.e. any number of equal elements may end up at position `index`), in-place (i.e. does not allocate), and *O*(*n*) worst-case. This function is also known as “kth element” in other libraries. It returns a triplet of the following values: all elements less than the one at the given index, the value at the given index, and all elements greater than the one at the given index, using the provided comparator function. ##### Current implementation The current algorithm is based on the quickselect portion of the same quicksort algorithm used for [`sort_unstable`](../primitive.slice#method.sort_unstable). ##### Panics Panics when `index >= len()`, meaning it always panics on empty slices. ##### Examples ``` let mut v = [-5i32, 4, 1, -3, 2]; // Find the median as if the slice were sorted in descending order. v.select_nth_unstable_by(2, |a, b| b.cmp(a)); // We are only guaranteed the slice will be one of the following, based on the way we sort // about the specified index. assert!(v == [2, 4, 1, -5, -3] || v == [2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2778-2785)1.49.0 · #### pub fn select\_nth\_unstable\_by\_key<K, F>( &mut self, index: usize, f: F) -> (&mut [T], &mut T, &mut [T])where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> K, K: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Reorder the slice with a key extraction function such that the element at `index` is at its final sorted position. This reordering has the additional property that any value at position `i < index` will be less than or equal to any value at a position `j > index` using the key extraction function. Additionally, this reordering is unstable (i.e. any number of equal elements may end up at position `index`), in-place (i.e. does not allocate), and *O*(*n*) worst-case. This function is also known as “kth element” in other libraries. It returns a triplet of the following values: all elements less than the one at the given index, the value at the given index, and all elements greater than the one at the given index, using the provided key extraction function. ##### Current implementation The current algorithm is based on the quickselect portion of the same quicksort algorithm used for [`sort_unstable`](../primitive.slice#method.sort_unstable). ##### Panics Panics when `index >= len()`, meaning it always panics on empty slices. ##### Examples ``` let mut v = [-5i32, 4, 1, -3, 2]; // Return the median as if the array were sorted according to absolute value. v.select_nth_unstable_by_key(2, |a| a.abs()); // We are only guaranteed the slice will be one of the following, based on the way we sort // about the specified index. assert!(v == [1, 2, -3, 4, -5] || v == [1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2813-2815)#### pub fn partition\_dedup(&mut self) -> (&mut [T], &mut [T])where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, 🔬This is a nightly-only experimental API. (`slice_partition_dedup` [#54279](https://github.com/rust-lang/rust/issues/54279)) Moves all consecutive repeated elements to the end of the slice according to the [`PartialEq`](../cmp/trait.partialeq "PartialEq") trait implementation. Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order. If the slice is sorted, the first returned slice contains no duplicates. ##### Examples ``` #![feature(slice_partition_dedup)] let mut slice = [1, 2, 2, 3, 3, 2, 1, 1]; let (dedup, duplicates) = slice.partition_dedup(); assert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2847-2849)#### pub fn partition\_dedup\_by<F>(&mut self, same\_bucket: F) -> (&mut [T], &mut [T])where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T, [&mut](../primitive.reference) T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`slice_partition_dedup` [#54279](https://github.com/rust-lang/rust/issues/54279)) Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation. Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order. The `same_bucket` function is passed references to two elements from the slice and must determine if the elements compare equal. The elements are passed in opposite order from their order in the slice, so if `same_bucket(a, b)` returns `true`, `a` is moved at the end of the slice. If the slice is sorted, the first returned slice contains no duplicates. ##### Examples ``` #![feature(slice_partition_dedup)] let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"]; let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b)); assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#2973-2976)#### pub fn partition\_dedup\_by\_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> K, K: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<K>, 🔬This is a nightly-only experimental API. (`slice_partition_dedup` [#54279](https://github.com/rust-lang/rust/issues/54279)) Moves all but the first of consecutive elements to the end of the slice that resolve to the same key. Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order. If the slice is sorted, the first returned slice contains no duplicates. ##### Examples ``` #![feature(slice_partition_dedup)] let mut slice = [10, 20, 21, 30, 30, 20, 11, 13]; let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10); assert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3012)1.26.0 · #### pub fn rotate\_left(&mut self, mid: usize) Rotates the slice in-place such that the first `mid` elements of the slice move to the end while the last `self.len() - mid` elements move to the front. After calling `rotate_left`, the element previously at index `mid` will become the first element in the slice. ##### Panics This function will panic if `mid` is greater than the length of the slice. Note that `mid == self.len()` does *not* panic and is a no-op rotation. ##### Complexity Takes linear (in `self.len()`) time. ##### Examples ``` let mut a = ['a', 'b', 'c', 'd', 'e', 'f']; a.rotate_left(2); assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']); ``` Rotating a subslice: ``` let mut a = ['a', 'b', 'c', 'd', 'e', 'f']; a[1..5].rotate_left(1); assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3055)1.26.0 · #### pub fn rotate\_right(&mut self, k: usize) Rotates the slice in-place such that the first `self.len() - k` elements of the slice move to the end while the last `k` elements move to the front. After calling `rotate_right`, the element previously at index `self.len() - k` will become the first element in the slice. ##### Panics This function will panic if `k` is greater than the length of the slice. Note that `k == self.len()` does *not* panic and is a no-op rotation. ##### Complexity Takes linear (in `self.len()`) time. ##### Examples ``` let mut a = ['a', 'b', 'c', 'd', 'e', 'f']; a.rotate_right(2); assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']); ``` Rotate a subslice: ``` let mut a = ['a', 'b', 'c', 'd', 'e', 'f']; a[1..5].rotate_right(1); assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3078-3080)1.50.0 · #### pub fn fill(&mut self, value: T)where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), Fills `self` with elements by cloning `value`. ##### Examples ``` let mut buf = vec![0; 10]; buf.fill(1); assert_eq!(buf, vec![1; 10]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3102-3104)1.51.0 · #### pub fn fill\_with<F>(&mut self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> T, Fills `self` with elements returned by calling a closure repeatedly. This method uses a closure to create new values. If you’d rather [`Clone`](../clone/trait.clone "Clone") a given value, use [`fill`](../primitive.slice#method.fill). If you want to use the [`Default`](../default/trait.default "Default") trait to generate values, you can pass [`Default::default`](../default/trait.default#tymethod.default "Default::default") as the argument. ##### Examples ``` let mut buf = vec![1; 10]; buf.fill_with(Default::default); assert_eq!(buf, vec![0; 10]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3165-3167)1.7.0 · #### pub fn clone\_from\_slice(&mut self, src: &[T])where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), Copies the elements from `src` into `self`. The length of `src` must be the same as `self`. ##### Panics This function will panic if the two slices have different lengths. ##### Examples Cloning two elements from a slice into another: ``` let src = [1, 2, 3, 4]; let mut dst = [0, 0]; // Because the slices have to be the same length, // we slice the source slice from four elements // to two. It will panic if we don't do this. dst.clone_from_slice(&src[2..]); assert_eq!(src, [1, 2, 3, 4]); assert_eq!(dst, [3, 4]); ``` Rust enforces that there can only be one mutable reference with no immutable references to a particular piece of data in a particular scope. Because of this, attempting to use `clone_from_slice` on a single slice will result in a compile failure: ⓘ ``` let mut slice = [1, 2, 3, 4, 5]; slice[..2].clone_from_slice(&slice[3..]); // compile fail! ``` To work around this, we can use [`split_at_mut`](../primitive.slice#method.split_at_mut) to create two distinct sub-slices from a slice: ``` let mut slice = [1, 2, 3, 4, 5]; { let (left, right) = slice.split_at_mut(2); left.clone_from_slice(&right[1..]); } assert_eq!(slice, [4, 5, 3, 4, 5]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3229-3231)1.9.0 · #### pub fn copy\_from\_slice(&mut self, src: &[T])where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), Copies all elements from `src` into `self`, using a memcpy. The length of `src` must be the same as `self`. If `T` does not implement `Copy`, use [`clone_from_slice`](../primitive.slice#method.clone_from_slice). ##### Panics This function will panic if the two slices have different lengths. ##### Examples Copying two elements from a slice into another: ``` let src = [1, 2, 3, 4]; let mut dst = [0, 0]; // Because the slices have to be the same length, // we slice the source slice from four elements // to two. It will panic if we don't do this. dst.copy_from_slice(&src[2..]); assert_eq!(src, [1, 2, 3, 4]); assert_eq!(dst, [3, 4]); ``` Rust enforces that there can only be one mutable reference with no immutable references to a particular piece of data in a particular scope. Because of this, attempting to use `copy_from_slice` on a single slice will result in a compile failure: ⓘ ``` let mut slice = [1, 2, 3, 4, 5]; slice[..2].copy_from_slice(&slice[3..]); // compile fail! ``` To work around this, we can use [`split_at_mut`](../primitive.slice#method.split_at_mut) to create two distinct sub-slices from a slice: ``` let mut slice = [1, 2, 3, 4, 5]; { let (left, right) = slice.split_at_mut(2); left.copy_from_slice(&right[1..]); } assert_eq!(slice, [4, 5, 3, 4, 5]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3283-3285)1.37.0 · #### pub fn copy\_within<R>(&mut self, src: R, dest: usize)where R: [RangeBounds](../ops/trait.rangebounds "trait std::ops::RangeBounds")<[usize](../primitive.usize)>, T: [Copy](../marker/trait.copy "trait std::marker::Copy"), Copies elements from one part of the slice to another part of itself, using a memmove. `src` is the range within `self` to copy from. `dest` is the starting index of the range within `self` to copy to, which will have the same length as `src`. The two ranges may overlap. The ends of the two ranges must be less than or equal to `self.len()`. ##### Panics This function will panic if either range exceeds the end of the slice, or if the end of `src` is before the start. ##### Examples Copying four bytes within a slice: ``` let mut bytes = *b"Hello, World!"; bytes.copy_within(1..5, 8); assert_eq!(&bytes, b"Hello, Wello!"); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3350)1.27.0 · #### pub fn swap\_with\_slice(&mut self, other: &mut [T]) Swaps all elements in `self` with those in `other`. The length of `other` must be the same as `self`. ##### Panics This function will panic if the two slices have different lengths. ##### Example Swapping two elements across slices: ``` let mut slice1 = [0, 0]; let mut slice2 = [1, 2, 3, 4]; slice1.swap_with_slice(&mut slice2[2..]); assert_eq!(slice1, [3, 4]); assert_eq!(slice2, [1, 2, 0, 0]); ``` Rust enforces that there can only be one mutable reference to a particular piece of data in a particular scope. Because of this, attempting to use `swap_with_slice` on a single slice will result in a compile failure: ⓘ ``` let mut slice = [1, 2, 3, 4, 5]; slice[..2].swap_with_slice(&mut slice[3..]); // compile fail! ``` To work around this, we can use [`split_at_mut`](../primitive.slice#method.split_at_mut) to create two distinct mutable sub-slices from a slice: ``` let mut slice = [1, 2, 3, 4, 5]; { let (left, right) = slice.split_at_mut(2); left.swap_with_slice(&mut right[1..]); } assert_eq!(slice, [4, 5, 3, 1, 2]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3460)1.30.0 · #### pub unsafe fn align\_to<U>(&self) -> (&[T], &[U], &[T]) Transmute the slice to a slice of another type, ensuring alignment of the types is maintained. This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The method may make the middle slice the greatest length possible for a given type and input slice, but only your algorithm’s performance should depend on that, not its correctness. It is permissible for all of the input data to be returned as the prefix or suffix slice. This method has no purpose when either input element `T` or output element `U` are zero-sized and will return the original slice without splitting anything. ##### Safety This method is essentially a `transmute` with respect to the elements in the returned middle slice, so all the usual caveats pertaining to `transmute::<T, U>` also apply here. ##### Examples Basic usage: ``` unsafe { let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7]; let (prefix, shorts, suffix) = bytes.align_to::<u16>(); // less_efficient_algorithm_for_bytes(prefix); // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3521)1.30.0 · #### pub unsafe fn align\_to\_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T]) Transmute the slice to a slice of another type, ensuring alignment of the types is maintained. This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The method may make the middle slice the greatest length possible for a given type and input slice, but only your algorithm’s performance should depend on that, not its correctness. It is permissible for all of the input data to be returned as the prefix or suffix slice. This method has no purpose when either input element `T` or output element `U` are zero-sized and will return the original slice without splitting anything. ##### Safety This method is essentially a `transmute` with respect to the elements in the returned middle slice, so all the usual caveats pertaining to `transmute::<T, U>` also apply here. ##### Examples Basic usage: ``` unsafe { let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7]; let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>(); // less_efficient_algorithm_for_bytes(prefix); // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); } ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3616-3620)#### pub fn as\_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [AsRef](../convert/trait.asref "trait std::convert::AsRef")<[[](../primitive.array)T[; LANES]](../primitive.array)>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Split a slice into a prefix, a middle of aligned SIMD types, and a suffix. This is a safe wrapper around [`slice::align_to`](../primitive.slice#method.align_to "slice::align_to"), so has the same weak postconditions as that method. You’re only assured that `self.len() == prefix.len() + middle.len() * LANES + suffix.len()`. Notably, all of the following are possible: * `prefix.len() >= LANES`. * `middle.is_empty()` despite `self.len() >= 3 * LANES`. * `suffix.len() >= LANES`. That said, this is a safe method, so if you’re only writing safe code, then this can at most cause incorrect logic, not unsoundness. ##### Panics This will panic if the size of the SIMD type is different from `LANES` times that of the scalar. At the time of writing, the trait restrictions on `Simd<T, LANES>` keeps that from ever happening, as only power-of-two numbers of lanes are supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like `LANES == 3`. ##### Examples ``` #![feature(portable_simd)] use core::simd::SimdFloat; let short = &[1, 2, 3]; let (prefix, middle, suffix) = short.as_simd::<4>(); assert_eq!(middle, []); // Not enough elements for anything in the middle // They might be split in any possible way between prefix and suffix let it = prefix.iter().chain(suffix).copied(); assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]); fn basic_simd_sum(x: &[f32]) -> f32 { use std::ops::Add; use std::simd::f32x4; let (prefix, middle, suffix) = x.as_simd(); let sums = f32x4::from_array([ prefix.iter().copied().sum(), 0.0, 0.0, suffix.iter().copied().sum(), ]); let sums = middle.iter().copied().fold(sums, f32x4::add); sums.reduce_sum() } let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3660-3664)#### pub fn as\_simd\_mut<const LANES: usize>( &mut self) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [AsMut](../convert/trait.asmut "trait std::convert::AsMut")<[[](../primitive.array)T[; LANES]](../primitive.array)>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), 🔬This is a nightly-only experimental API. (`portable_simd` [#86656](https://github.com/rust-lang/rust/issues/86656)) Split a slice into a prefix, a middle of aligned SIMD types, and a suffix. This is a safe wrapper around [`slice::align_to_mut`](../primitive.slice#method.align_to_mut "slice::align_to_mut"), so has the same weak postconditions as that method. You’re only assured that `self.len() == prefix.len() + middle.len() * LANES + suffix.len()`. Notably, all of the following are possible: * `prefix.len() >= LANES`. * `middle.is_empty()` despite `self.len() >= 3 * LANES`. * `suffix.len() >= LANES`. That said, this is a safe method, so if you’re only writing safe code, then this can at most cause incorrect logic, not unsoundness. This is the mutable version of [`slice::as_simd`](../primitive.slice#method.as_simd "slice::as_simd"); see that for examples. ##### Panics This will panic if the size of the SIMD type is different from `LANES` times that of the scalar. At the time of writing, the trait restrictions on `Simd<T, LANES>` keeps that from ever happening, as only power-of-two numbers of lanes are supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like `LANES == 3`. [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3700-3702)#### pub fn is\_sorted(&self) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this slice are sorted. That is, for each element `a` and its following element `b`, `a <= b` must hold. If the slice yields exactly zero or one element, `true` is returned. Note that if `Self::Item` is only `PartialOrd`, but not `Ord`, the above definition implies that this function returns `false` if any two consecutive items are not comparable. ##### Examples ``` #![feature(is_sorted)] let empty: [i32; 0] = []; assert!([1, 2, 2, 9].is_sorted()); assert!(![1, 3, 2, 4].is_sorted()); assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted()); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3716-3718)#### pub fn is\_sorted\_by<F>(&self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this slice are sorted using the given comparator function. Instead of using `PartialOrd::partial_cmp`, this function uses the given `compare` function to determine the ordering of two elements. Apart from that, it’s equivalent to [`is_sorted`](../primitive.slice#method.is_sorted); see its documentation for more information. [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3742-3745)#### pub fn is\_sorted\_by\_key<F, K>(&self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this slice are sorted using the given key extraction function. Instead of comparing the slice’s elements directly, this function compares the keys of the elements, as determined by `f`. Apart from that, it’s equivalent to [`is_sorted`](../primitive.slice#method.is_sorted); see its documentation for more information. ##### Examples ``` #![feature(is_sorted)] assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len())); assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs())); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3791-3793)1.52.0 · #### pub fn partition\_point<P>(&self, pred: P) -> usizewhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), Returns the index of the partition point according to the given predicate (the index of the first element of the second partition). The slice is assumed to be partitioned according to the given predicate. This means that all elements for which the predicate returns true are at the start of the slice and all elements for which the predicate returns false are at the end. For example, [7, 15, 3, 5, 4, 12, 6] is a partitioned under the predicate x % 2 != 0 (all odd numbers are at the start, all even at the end). If this slice is not partitioned, the returned result is unspecified and meaningless, as this method performs a kind of binary search. See also [`binary_search`](../primitive.slice#method.binary_search), [`binary_search_by`](../primitive.slice#method.binary_search_by), and [`binary_search_by_key`](../primitive.slice#method.binary_search_by_key). ##### Examples ``` let v = [1, 2, 3, 3, 5, 6, 7]; let i = v.partition_point(|&x| x < 5); assert_eq!(i, 4); assert!(v[..i].iter().all(|&x| x < 5)); assert!(v[i..].iter().all(|&x| !(x < 5))); ``` If you want to insert an item to a sorted vector, while maintaining sort order: ``` let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; let num = 42; let idx = s.partition_point(|&x| x < num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3849)#### pub fn take<R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>where R: [OneSidedRange](../ops/trait.onesidedrange "trait std::ops::OneSidedRange")<[usize](../primitive.usize)>, 🔬This is a nightly-only experimental API. (`slice_take` [#62280](https://github.com/rust-lang/rust/issues/62280)) Removes the subslice corresponding to the given range and returns a reference to it. Returns `None` and does not modify the slice if the given range is out of bounds. Note that this method only accepts one-sided ranges such as `2..` or `..6`, but not `2..6`. ##### Examples Taking the first three elements of a slice: ``` #![feature(slice_take)] let mut slice: &[_] = &['a', 'b', 'c', 'd']; let mut first_three = slice.take(..3).unwrap(); assert_eq!(slice, &['d']); assert_eq!(first_three, &['a', 'b', 'c']); ``` Taking the last two elements of a slice: ``` #![feature(slice_take)] let mut slice: &[_] = &['a', 'b', 'c', 'd']; let mut tail = slice.take(2..).unwrap(); assert_eq!(slice, &['a', 'b']); assert_eq!(tail, &['c', 'd']); ``` Getting `None` when `range` is out of bounds: ``` #![feature(slice_take)] let mut slice: &[_] = &['a', 'b', 'c', 'd']; assert_eq!(None, slice.take(5..)); assert_eq!(None, slice.take(..5)); assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4)); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3918-3921)#### pub fn take\_mut<R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>where R: [OneSidedRange](../ops/trait.onesidedrange "trait std::ops::OneSidedRange")<[usize](../primitive.usize)>, 🔬This is a nightly-only experimental API. (`slice_take` [#62280](https://github.com/rust-lang/rust/issues/62280)) Removes the subslice corresponding to the given range and returns a mutable reference to it. Returns `None` and does not modify the slice if the given range is out of bounds. Note that this method only accepts one-sided ranges such as `2..` or `..6`, but not `2..6`. ##### Examples Taking the first three elements of a slice: ``` #![feature(slice_take)] let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd']; let mut first_three = slice.take_mut(..3).unwrap(); assert_eq!(slice, &mut ['d']); assert_eq!(first_three, &mut ['a', 'b', 'c']); ``` Taking the last two elements of a slice: ``` #![feature(slice_take)] let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd']; let mut tail = slice.take_mut(2..).unwrap(); assert_eq!(slice, &mut ['a', 'b']); assert_eq!(tail, &mut ['c', 'd']); ``` Getting `None` when `range` is out of bounds: ``` #![feature(slice_take)] let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(None, slice.take_mut(5..)); assert_eq!(None, slice.take_mut(..5)); assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4)); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3957)#### pub fn take\_first(self: &mut &'a [T]) -> Option<&'a T> 🔬This is a nightly-only experimental API. (`slice_take` [#62280](https://github.com/rust-lang/rust/issues/62280)) Removes the first element of the slice and returns a reference to it. Returns `None` if the slice is empty. ##### Examples ``` #![feature(slice_take)] let mut slice: &[_] = &['a', 'b', 'c']; let first = slice.take_first().unwrap(); assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a'); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#3982)#### pub fn take\_first\_mut(self: &mut &'a mut [T]) -> Option<&'a mut T> 🔬This is a nightly-only experimental API. (`slice_take` [#62280](https://github.com/rust-lang/rust/issues/62280)) Removes the first element of the slice and returns a mutable reference to it. Returns `None` if the slice is empty. ##### Examples ``` #![feature(slice_take)] let mut slice: &mut [_] = &mut ['a', 'b', 'c']; let first = slice.take_first_mut().unwrap(); *first = 'd'; assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d'); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4006)#### pub fn take\_last(self: &mut &'a [T]) -> Option<&'a T> 🔬This is a nightly-only experimental API. (`slice_take` [#62280](https://github.com/rust-lang/rust/issues/62280)) Removes the last element of the slice and returns a reference to it. Returns `None` if the slice is empty. ##### Examples ``` #![feature(slice_take)] let mut slice: &[_] = &['a', 'b', 'c']; let last = slice.take_last().unwrap(); assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c'); ``` [source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4031)#### pub fn take\_last\_mut(self: &mut &'a mut [T]) -> Option<&'a mut T> 🔬This is a nightly-only experimental API. (`slice_take` [#62280](https://github.com/rust-lang/rust/issues/62280)) Removes the last element of the slice and returns a mutable reference to it. Returns `None` if the slice is empty. ##### Examples ``` #![feature(slice_take)] let mut slice: &mut [_] = &mut ['a', 'b', 'c']; let last = slice.take_last_mut().unwrap(); *last = 'd'; assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d'); ``` [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#15)1.23.0 · #### pub fn is\_ascii(&self) -> bool Checks if all bytes in this slice are within the ASCII range. [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#26)1.23.0 · #### pub fn eq\_ignore\_ascii\_case(&self, other: &[u8]) -> bool Checks that two slices are an ASCII case-insensitive match. Same as `to_ascii_lowercase(a) == to_ascii_lowercase(b)`, but without allocating and copying temporaries. [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#41)1.23.0 · #### pub fn make\_ascii\_uppercase(&mut self) Converts this slice to its ASCII upper case equivalent in-place. ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged. To return a new uppercased value without modifying the existing one, use [`to_ascii_uppercase`](#method.to_ascii_uppercase). [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#58)1.23.0 · #### pub fn make\_ascii\_lowercase(&mut self) Converts this slice to its ASCII lower case equivalent in-place. ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged. To return a new lowercased value without modifying the existing one, use [`to_ascii_lowercase`](#method.to_ascii_lowercase). [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#78)1.60.0 · #### pub fn escape\_ascii(&self) -> EscapeAscii<'\_> Notable traits for [EscapeAscii](../slice/struct.escapeascii "struct std::slice::EscapeAscii")<'a> ``` impl<'a> Iterator for EscapeAscii<'a> type Item = u8; ``` Returns an iterator that produces an escaped version of this slice, treating it as an ASCII string. ##### Examples ``` let s = b"0\t\r\n'\"\\\x9d"; let escaped = s.escape_ascii().to_string(); assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d"); ``` [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#97)#### pub fn trim\_ascii\_start(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`byte_slice_trim_ascii` [#94035](https://github.com/rust-lang/rust/issues/94035)) Returns a byte slice with leading ASCII whitespace bytes removed. ‘Whitespace’ refers to the definition used by `u8::is_ascii_whitespace`. ##### Examples ``` #![feature(byte_slice_trim_ascii)] assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n"); assert_eq!(b" ".trim_ascii_start(), b""); assert_eq!(b"".trim_ascii_start(), b""); ``` [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#126)#### pub fn trim\_ascii\_end(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`byte_slice_trim_ascii` [#94035](https://github.com/rust-lang/rust/issues/94035)) Returns a byte slice with trailing ASCII whitespace bytes removed. ‘Whitespace’ refers to the definition used by `u8::is_ascii_whitespace`. ##### Examples ``` #![feature(byte_slice_trim_ascii)] assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world"); assert_eq!(b" ".trim_ascii_end(), b""); assert_eq!(b"".trim_ascii_end(), b""); ``` [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#156)#### pub fn trim\_ascii(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`byte_slice_trim_ascii` [#94035](https://github.com/rust-lang/rust/issues/94035)) Returns a byte slice with leading and trailing ASCII whitespace bytes removed. ‘Whitespace’ refers to the definition used by `u8::is_ascii_whitespace`. ##### Examples ``` #![feature(byte_slice_trim_ascii)] assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world"); assert_eq!(b" ".trim_ascii(), b""); assert_eq!(b"".trim_ascii(), b""); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#618)1.23.0 · #### pub fn to\_ascii\_uppercase(&self) -> Vec<u8, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent. ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged. To uppercase the value in-place, use [`make_ascii_uppercase`](../primitive.slice#method.make_ascii_uppercase). [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#639)1.23.0 · #### pub fn to\_ascii\_lowercase(&self) -> Vec<u8, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent. ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged. To lowercase the value in-place, use [`make_ascii_lowercase`](../primitive.slice#method.make_ascii_lowercase). [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#204-206)#### pub fn sort(&mut self)where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Sorts the slice. This sort is stable (i.e., does not reorder equal elements) and *O*(*n* \* log(*n*)) worst-case. When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See [`sort_unstable`](../primitive.slice#method.sort_unstable). ##### Current implementation The current algorithm is an adaptive, iterative merge sort inspired by [timsort](https://en.wikipedia.org/wiki/Timsort). It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another. Also, it allocates temporary storage half the size of `self`, but for short slices a non-allocating insertion sort is used instead. ##### Examples ``` let mut v = [-5, 4, 1, -3, 2]; v.sort(); assert!(v == [-5, -3, 1, 2, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#260-262)#### pub fn sort\_by<F>(&mut self, compare: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Sorts the slice with a comparator function. This sort is stable (i.e., does not reorder equal elements) and *O*(*n* \* log(*n*)) worst-case. The comparator function must define a total ordering for the elements in the slice. If the ordering is not total, the order of the elements is unspecified. An order is a total order if it is (for all `a`, `b` and `c`): * total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true, and * transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`. For example, while [`f64`](../primitive.f64 "f64") doesn’t implement [`Ord`](../cmp/trait.ord "Ord") because `NaN != NaN`, we can use `partial_cmp` as our sort function when we know the slice doesn’t contain a `NaN`. ``` let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0]; floats.sort_by(|a, b| a.partial_cmp(b).unwrap()); assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]); ``` When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See [`sort_unstable_by`](../primitive.slice#method.sort_unstable_by). ##### Current implementation The current algorithm is an adaptive, iterative merge sort inspired by [timsort](https://en.wikipedia.org/wiki/Timsort). It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another. Also, it allocates temporary storage half the size of `self`, but for short slices a non-allocating insertion sort is used instead. ##### Examples ``` let mut v = [5, 4, 1, 3, 2]; v.sort_by(|a, b| a.cmp(b)); assert!(v == [1, 2, 3, 4, 5]); // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert!(v == [5, 4, 3, 2, 1]); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#302-305)1.7.0 · #### pub fn sort\_by\_key<K, F>(&mut self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> K, K: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Sorts the slice with a key extraction function. This sort is stable (i.e., does not reorder equal elements) and *O*(*m* \* *n* \* log(*n*)) worst-case, where the key function is *O*(*m*). For expensive key functions (e.g. functions that are not simple property accesses or basic operations), [`sort_by_cached_key`](../primitive.slice#method.sort_by_cached_key) is likely to be significantly faster, as it does not recompute element keys. When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See [`sort_unstable_by_key`](../primitive.slice#method.sort_unstable_by_key). ##### Current implementation The current algorithm is an adaptive, iterative merge sort inspired by [timsort](https://en.wikipedia.org/wiki/Timsort). It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another. Also, it allocates temporary storage half the size of `self`, but for short slices a non-allocating insertion sort is used instead. ##### Examples ``` let mut v = [-5i32, 4, 1, -3, 2]; v.sort_by_key(|k| k.abs()); assert!(v == [1, 2, -3, 4, -5]); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#349-352)1.34.0 · #### pub fn sort\_by\_cached\_key<K, F>(&mut self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> K, K: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Sorts the slice with a key extraction function. During sorting, the key function is called at most once per element, by using temporary storage to remember the results of key evaluation. The order of calls to the key function is unspecified and may change in future versions of the standard library. This sort is stable (i.e., does not reorder equal elements) and *O*(*m* \* *n* + *n* \* log(*n*)) worst-case, where the key function is *O*(*m*). For simple key functions (e.g., functions that are property accesses or basic operations), [`sort_by_key`](../primitive.slice#method.sort_by_key) is likely to be faster. ##### Current implementation The current algorithm is based on [pattern-defeating quicksort](https://github.com/orlp/pdqsort) by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior. In the worst case, the algorithm allocates temporary storage in a `Vec<(K, usize)>` the length of the slice. ##### Examples ``` let mut v = [-5i32, 4, 32, -3, 2]; v.sort_by_cached_key(|k| k.to_string()); assert!(v == [-3, -5, 2, 32, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#409-411)#### pub fn to\_vec(&self) -> Vec<T, Global>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Copies `self` into a new `Vec`. ##### Examples ``` let s = [10, 40, 30]; let x = s.to_vec(); // Here, `s` and `x` can be modified independently. ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#433-435)#### pub fn to\_vec\_in<A>(&self, alloc: A) -> Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Copies `self` into a new `Vec` with an allocator. ##### Examples ``` #![feature(allocator_api)] use std::alloc::System; let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently. ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#486-488)1.40.0 · #### pub fn repeat(&self, n: usize) -> Vec<T, Global>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Creates a vector by repeating a slice `n` times. ##### Panics This function will panic if the capacity would overflow. ##### Examples Basic usage: ``` assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]); ``` A panic upon overflow: ⓘ ``` // this will panic at runtime b"0123456789abcdef".repeat(usize::MAX); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#554-556)#### pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Outputwhere Item: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [[T]](../primitive.slice): [Concat](../slice/trait.concat "trait std::slice::Concat")<Item>, Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Flattens a slice of `T` into a single value `Self::Output`. ##### Examples ``` assert_eq!(["hello", "world"].concat(), "helloworld"); assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#573-575)1.3.0 · #### pub fn join<Separator>(&self, sep: Separator) -> <[T] as Join<Separator>>::Outputwhere [[T]](../primitive.slice): [Join](../slice/trait.join "trait std::slice::Join")<Separator>, Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Flattens a slice of `T` into a single value `Self::Output`, placing a given separator between each. ##### Examples ``` assert_eq!(["hello", "world"].join(" "), "hello world"); assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]); assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]); ``` [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#593-595)#### pub fn connect<Separator>( &self, sep: Separator) -> <[T] as Join<Separator>>::Outputwhere [[T]](../primitive.slice): [Join](../slice/trait.join "trait std::slice::Join")<Separator>, Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 👎Deprecated since 1.3.0: renamed to join Flattens a slice of `T` into a single value `Self::Output`, placing a given separator between each. ##### Examples ``` assert_eq!(["hello", "world"].connect(" "), "hello world"); assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2967)1.5.0 · ### impl<T, A> AsMut<[T]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2968)#### fn as\_mut(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this type into a mutable reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2953)1.5.0 · ### impl<T, A> AsMut<Vec<T, A>> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2954)#### fn as\_mut(&mut self) -> &mut Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Converts this type into a mutable reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2960)### impl<T, A> AsRef<[T]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2961)#### fn as\_ref(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2946)### impl<T, A> AsRef<Vec<T, A>> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2947)#### fn as\_ref(&self) -> &Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#769)### impl<T, A> Borrow<[T]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#770)#### fn borrow(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#776)### impl<T, A> BorrowMut<[T]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#777)#### fn borrow\_mut(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2576)### impl<T, A> Clone for Vec<T, A>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2578)#### fn clone(&self) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2593)#### fn clone\_from(&mut self, other: &Vec<T, A>) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2939)### impl<T, A> Debug for Vec<T, A>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2940)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2929)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · ### impl<T> Default for Vec<T, Global> [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2933)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Creates an empty `Vec<T>`. The vector will not allocate until elements are pushed onto it. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2528)### impl<T, A> Deref for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Target = [T] The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2532)#### fn deref(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Dereferences the value. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2538)### impl<T, A> DerefMut for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2540)#### fn deref\_mut(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Mutably dereferences the value. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2915)### impl<T, A> Drop for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2916)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2877)1.2.0 · ### impl<'a, T, A> Extend<&'a T> for Vec<T, A>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), A: 'a + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Extend implementation that copies elements out of references before pushing them onto the Vec. This implementation is specialized for slice iterators, where it uses [`copy_from_slice`](../primitive.slice#method.copy_from_slice) to append the entire slice at once. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2878)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [&'a](../primitive.reference) T>, Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2883)#### fn extend\_one(&mut self, &'a T) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2888)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2720)### impl<T, A> Extend<T> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2722)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = T>, Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2727)#### fn extend\_one(&mut self, item: T) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2732)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#33)1.28.0 · ### impl<'a, T> From<&'a Vec<T, Global>> for Cow<'a, [T]>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#40)#### fn from(v: &'a Vec<T, Global>) -> Cow<'a, [T]> Creates a [`Borrowed`](../borrow/enum.cow#variant.Borrowed) variant of [`Cow`](../borrow/enum.cow "Cow") from a reference to [`Vec`](struct.vec "Vec"). This conversion does not allocate or clone the data. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2975)### impl<T> From<&[T]> for Vec<T, Global>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2984)#### fn from(s: &[T]) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Allocate a `Vec<T>` and fill it by cloning `s`’s items. ##### Examples ``` assert_eq!(Vec::from(&[1, 2, 3][..]), vec![1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2995)1.19.0 · ### impl<T> From<&mut [T]> for Vec<T, Global>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3004)#### fn from(s: &mut [T]) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Allocate a `Vec<T>` and fill it by cloning `s`’s items. ##### Examples ``` assert_eq!(Vec::from(&mut [1, 2, 3][..]), vec![1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3101)### impl From<&str> for Vec<u8, Global> [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3109)#### fn from(s: &str) -> Vec<u8, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Allocate a `Vec<u8>` and fill it with a UTF-8 string. ##### Examples ``` assert_eq!(Vec::from("123"), vec![b'1', b'2', b'3']); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3015)1.44.0 · ### impl<T, const N: usize> From<[T; N]> for Vec<T, Global> [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3024)#### fn from(s: [T; N]) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Allocate a `Vec<T>` and move `s`’s items into it. ##### Examples ``` assert_eq!(Vec::from([1, 2, 3]), vec![1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1602)1.5.0 · ### impl<T> From<BinaryHeap<T>> for Vec<T, Global> [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1607)#### fn from(heap: BinaryHeap<T>) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Converts a `BinaryHeap<T>` into a `Vec<T>`. This conversion requires no data movement or allocation, and has constant time complexity. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3064)1.18.0 · ### impl<T, A> From<Box<[T], A>> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3074)#### fn from(s: Box<[T], A>) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Convert a boxed slice into a vector by transferring ownership of the existing heap allocation. ##### Examples ``` let b: Box<[i32]> = vec![1, 2, 3].into_boxed_slice(); assert_eq!(Vec::from(b), vec![1, 2, 3]); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#726)1.7.0 · ### impl From<CString> for Vec<u8, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#731)#### fn from(s: CString) -> Vec<u8, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Converts a [`CString`](../ffi/struct.cstring "CString") into a `[Vec](struct.vec "Vec")<[u8](../primitive.u8 "u8")>`. The conversion consumes the [`CString`](../ffi/struct.cstring "CString"), and removes the terminating NUL byte. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3038)1.14.0 · ### impl<'a, T> From<Cow<'a, [T]>> for Vec<T, Global>where [[T]](../primitive.slice): [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned"), <[[T]](../primitive.slice) as [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned")>::[Owned](../borrow/trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned") == [Vec](struct.vec "struct std::vec::Vec")<T, [Global](../alloc/struct.global "struct std::alloc::Global")>, [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3056)#### fn from(s: Cow<'a, [T]>) -> Vec<T, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Convert a clone-on-write slice into a vector. If `s` already owns a `Vec<T>`, it will be returned directly. If `s` is borrowing a slice, a new `Vec<T>` will be allocated and filled by cloning `s`’s items into it. ##### Examples ``` let o: Cow<[i32]> = Cow::Owned(vec![1, 2, 3]); let b: Cow<[i32]> = Cow::Borrowed(&[1, 2, 3]); assert_eq!(Vec::from(o), Vec::from(b)); ``` [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2814)1.14.0 · ### impl From<String> for Vec<u8, Global> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2829)#### fn from(string: String) -> Vec<u8, Global> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Converts the given [`String`](../string/struct.string "String") to a vector [`Vec`](struct.vec "Vec") that holds values of type [`u8`](../primitive.u8 "u8"). ##### Examples Basic usage: ``` let s1 = String::from("hello world"); let v1 = Vec::from(s1); for b in v1 { println!("{b}"); } ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#798)1.43.0 · ### impl From<Vec<NonZeroU8, Global>> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#802)#### fn from(v: Vec<NonZeroU8, Global>) -> CString Converts a `[Vec](struct.vec "Vec")<[NonZeroU8](../num/struct.nonzerou8 "NonZeroU8")>` into a [`CString`](../ffi/struct.cstring "CString") without copying nor checking for inner null bytes. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3083)1.20.0 · ### impl<T, A> From<Vec<T, A>> for Box<[T], A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3094)#### fn from(v: Vec<T, A>) -> Box<[T], A> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Convert a vector into a boxed slice. If `v` has excess capacity, its items will be moved into a newly-allocated buffer with exactly the right capacity. ##### Examples ``` assert_eq!(Box::from(vec![1, 2, 3]), vec![1, 2, 3].into_boxed_slice()); ``` [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#3030)1.10.0 · ### impl<T, A> From<Vec<T, A>> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#3039)#### fn from(other: Vec<T, A>) -> VecDeque<T, A> Notable traits for [VecDeque](../collections/struct.vecdeque "struct std::collections::VecDeque")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Read for VecDeque<u8, A> impl<A: Allocator> Write for VecDeque<u8, A> ``` Turn a [`Vec<T>`](struct.vec) into a [`VecDeque<T>`](../collections/struct.vecdeque). 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. [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2560)1.21.0 · ### impl<T> From<Vec<T, Global>> for Arc<[T]> [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2572)#### fn from(v: Vec<T, Global>) -> Arc<[T]> Allocate a reference-counted slice and move `v`’s items into it. ##### Example ``` let unique: Vec<i32> = vec![1, 2, 3]; let shared: Arc<[i32]> = Arc::from(unique); assert_eq!(&[1, 2, 3], &shared[..]); ``` [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1574)1.5.0 · ### impl<T> From<Vec<T, Global>> for BinaryHeap<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1578)#### fn from(vec: Vec<T, Global>) -> BinaryHeap<T> Converts a `Vec<T>` into a `BinaryHeap<T>`. This conversion happens in-place, and has *O*(*n*) time complexity. [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#20)1.8.0 · ### impl<'a, T> From<Vec<T, Global>> for Cow<'a, [T]>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#27)#### fn from(v: Vec<T, Global>) -> Cow<'a, [T]> Creates an [`Owned`](../borrow/enum.cow#variant.Owned) variant of [`Cow`](../borrow/enum.cow "Cow") from an owned instance of [`Vec`](struct.vec "Vec"). This conversion does not allocate or clone the data. [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1956)1.21.0 · ### impl<T> From<Vec<T, Global>> for Rc<[T]> [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1968)#### fn from(v: Vec<T, Global>) -> Rc<[T]> Allocate a reference-counted slice and move `v`’s items into it. ##### Example ``` let original: Box<Vec<i32>> = Box::new(vec![1, 2, 3]); let shared: Rc<Vec<i32>> = Rc::from(original); assert_eq!(vec![1, 2, 3], *shared); ``` [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#3065)1.10.0 · ### impl<T, A> From<VecDeque<T, A>> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#3095)#### fn from(other: VecDeque<T, A>) -> Vec<T, A> Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Turn a [`VecDeque<T>`](../collections/struct.vecdeque) into a [`Vec<T>`](struct.vec). 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); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2646)### impl<T> FromIterator<T> for Vec<T, Global> [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2648)#### fn from\_iter<I>(iter: I) -> Vec<T, Global>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = T>, Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2611)### impl<T, A> Hash for Vec<T, A>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), The hash of a vector is the same as that of the corresponding slice, as required by the `core::borrow::Borrow` implementation. ``` #![feature(build_hasher_simple_hash_one)] use std::hash::BuildHasher; let b = std::collections::hash_map::RandomState::new(); let v: Vec<u8> = vec![0xa8, 0x3c, 0x09]; let s: &[u8] = &[0xa8, 0x3c, 0x09]; assert_eq!(b.hash_one(v), b.hash_one(s)); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2613)#### fn hash<H>(&self, state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2623)### impl<T, I, A> Index<I> for Vec<T, A>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Output = <I as SliceIndex<[T]>>::Output The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2627)#### fn index(&self, index: I) -> &<Vec<T, A> as Index<I>>::Output Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Performs the indexing (`container[index]`) operation. [Read more](../ops/trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2637)### impl<T, I, A> IndexMut<I> for Vec<T, A>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2639)#### fn index\_mut(&mut self, index: I) -> &mut <Vec<T, A> as Index<I>>::Output Notable traits for [Vec](struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Performs the mutable indexing (`container[index]`) operation. [Read more](../ops/trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2699)### impl<'a, T, A> IntoIterator for &'a Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Item = &'a T The type of the elements being iterated over. #### type IntoIter = Iter<'a, T> Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2703)#### fn into\_iter(self) -> Iter<'a, T> Notable traits for [Iter](../slice/struct.iter "struct std::slice::Iter")<'a, T> ``` impl<'a, T> Iterator for Iter<'a, T> type Item = &'a T; ``` Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2709)### impl<'a, T, A> IntoIterator for &'a mut Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Item = &'a mut T The type of the elements being iterated over. #### type IntoIter = IterMut<'a, T> Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2713)#### fn into\_iter(self) -> IterMut<'a, T> Notable traits for [IterMut](../slice/struct.itermut "struct std::slice::IterMut")<'a, T> ``` impl<'a, T> Iterator for IterMut<'a, T> type Item = &'a mut T; ``` Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2654)### impl<T, A> IntoIterator for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2675)#### fn into\_iter(self) -> IntoIter<T, A> Notable traits for [IntoIter](struct.intoiter "struct std::vec::IntoIter")<T, A> ``` impl<T, A> Iterator for IntoIter<T, A>where     A: Allocator, type Item = T; ``` Creates a consuming iterator, that is, one that moves each value out of the vector (from start to end). The vector cannot be used after calling this. ##### Examples ``` let v = vec!["a".to_string(), "b".to_string()]; let mut v_iter = v.into_iter(); let first_element: Option<String> = v_iter.next(); assert_eq!(first_element, Some("a".to_string())); assert_eq!(v_iter.next(), Some("b".to_string())); assert_eq!(v_iter.next(), None); ``` #### type Item = T The type of the elements being iterated over. #### type IntoIter = IntoIter<T, A> Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2907)### impl<T, A> Ord for Vec<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Implements ordering of vectors, [lexicographically](../cmp/trait.ord#lexicographical-comparison). [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2909)#### fn cmp(&self, other: &Vec<T, A>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#37)### impl<T, U, A, const N: usize> PartialEq<&[U; N]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#37)#### fn eq(&self, other: &&[U; N]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#37)#### fn ne(&self, other: &&[U; N]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#24)### impl<T, U, A> PartialEq<&[U]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#24)#### fn eq(&self, other: &&[U]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#24)#### fn ne(&self, other: &&[U]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#25)### impl<T, U, A> PartialEq<&mut [U]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#25)#### fn eq(&self, other: &&mut [U]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#25)#### fn ne(&self, other: &&mut [U]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#36)### impl<T, U, A, const N: usize> PartialEq<[U; N]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#36)#### fn eq(&self, other: &[U; N]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#36)#### fn ne(&self, other: &[U; N]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#28)1.48.0 · ### impl<T, U, A> PartialEq<[U]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#28)#### fn eq(&self, other: &[U]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#28)#### fn ne(&self, other: &[U]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#26)1.46.0 · ### impl<T, U, A> PartialEq<Vec<U, A>> for &[T]where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#26)#### fn eq(&self, other: &Vec<U, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#26)#### fn ne(&self, other: &Vec<U, A>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#27)1.46.0 · ### impl<T, U, A> PartialEq<Vec<U, A>> for &mut [T]where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#27)#### fn eq(&self, other: &Vec<U, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#27)#### fn ne(&self, other: &Vec<U, A>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#29)1.48.0 · ### impl<T, U, A> PartialEq<Vec<U, A>> for [T]where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#29)#### fn eq(&self, other: &Vec<U, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#29)#### fn ne(&self, other: &Vec<U, A>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#31)### impl<T, U, A> PartialEq<Vec<U, A>> for Cow<'\_, [T]>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U> + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#31)#### fn eq(&self, other: &Vec<U, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#31)#### fn ne(&self, other: &Vec<U, A>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2891)1.17.0 · ### impl<T, U, A> PartialEq<Vec<U, A>> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2891)#### fn eq(&self, other: &Vec<U, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#23)### impl<T, U, A1, A2> PartialEq<Vec<U, A2>> for Vec<T, A1>where A1: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), A2: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U>, [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#23)#### fn eq(&self, other: &Vec<U, A2>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#23)#### fn ne(&self, other: &Vec<U, A2>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2895)### impl<T, A> PartialOrd<Vec<T, A>> for Vec<T, A>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Implements comparison of vectors, [lexicographically](../cmp/trait.ord#lexicographical-comparison). [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2897)#### fn partial\_cmp(&self, other: &Vec<T, A>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3115)1.48.0 · ### impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3144)#### fn try\_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>> Gets the entire contents of the `Vec<T>` as an array, if its size exactly matches that of the requested array. ##### Examples ``` assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3])); assert_eq!(<Vec<i32>>::new().try_into(), Ok([])); ``` If the length doesn’t match, the input comes back in `Err`: ``` let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into(); assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9])); ``` If you’re fine with just getting a prefix of the `Vec<T>`, you can call [`.truncate(N)`](struct.vec#method.truncate) first. ``` let mut v = String::from("hello world").into_bytes(); v.sort(); v.truncate(2); let [a, b]: [_; 2] = v.try_into().unwrap(); assert_eq!(a, b' '); assert_eq!(b, b'd'); ``` #### type Error = Vec<T, A> The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#381-413)### impl<A: Allocator> Write for Vec<u8, A> Write is implemented for `Vec<u8>` by appending to the vector. The vector will grow as needed. [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#383-386)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](../io/trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#389-396)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](../io/trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](../io/trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#399-401)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](../io/trait.write#method.write_vectored) implementation. [Read more](../io/trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#404-407)#### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](../io/trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/impls.rs.html#410-412)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](../io/trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](../io/trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)#### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](../io/trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)#### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](../io/trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2903)### impl<T, A> Eq for Vec<T, A>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Auto Trait Implementations -------------------------- ### impl<T, A> RefUnwindSafe for Vec<T, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> Send for Vec<T, A>where A: [Send](../marker/trait.send "trait std::marker::Send"), T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T, A> Sync for Vec<T, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T, A> Unpin for Vec<T, A>where A: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T, A> UnwindSafe for Vec<T, A>where A: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::vec Module std::vec =============== A contiguous growable array type with heap-allocated contents, written `Vec<T>`. Vectors have *O*(1) indexing, amortized *O*(1) push (to the end) and *O*(1) pop (from the end). Vectors ensure they never allocate more than `isize::MAX` bytes. Examples -------- You can explicitly create a [`Vec`](struct.vec "Vec") with [`Vec::new`](struct.vec#method.new "Vec::new"): ``` let v: Vec<i32> = Vec::new(); ``` …or by using the [`vec!`](../macro.vec "vec!") macro: ``` let v: Vec<i32> = vec![]; let v = vec![1, 2, 3, 4, 5]; let v = vec![0; 10]; // ten zeroes ``` You can [`push`](struct.vec#method.push) values onto the end of a vector (which will grow the vector as needed): ``` let mut v = vec![1, 2]; v.push(3); ``` Popping values works in much the same way: ``` let mut v = vec![1, 2]; let two = v.pop(); ``` Vectors also support indexing (through the [`Index`](../ops/trait.index "Index") and [`IndexMut`](../ops/trait.indexmut "IndexMut") traits): ``` let mut v = vec![1, 2, 3]; let three = v[2]; v[1] = v[1] + 5; ``` Structs ------- [DrainFilter](struct.drainfilter "std::vec::DrainFilter struct")Experimental An iterator which uses a closure to determine if an element should be removed. [Drain](struct.drain "std::vec::Drain struct") A draining iterator for `Vec<T>`. [IntoIter](struct.intoiter "std::vec::IntoIter struct") An iterator that moves out of a vector. [Splice](struct.splice "std::vec::Splice struct") A splicing iterator for `Vec`. [Vec](struct.vec "std::vec::Vec struct") A contiguous growable array type, written as `Vec<T>`, short for ‘vector’. rust Struct std::vec::IntoIter Struct std::vec::IntoIter ========================= ``` pub struct IntoIter<T, A = Global>where    A: Allocator,{ /* private fields */ } ``` An iterator that moves out of a vector. This `struct` is created by the `into_iter` method on [`Vec`](struct.vec) (provided by the [`IntoIterator`](../iter/trait.intoiterator "IntoIterator") trait). Example ------- ``` let v = vec![0, 1, 2]; let iter: std::vec::IntoIter<_> = v.into_iter(); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#51)### impl<T, A> IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#64)1.15.0 · #### pub fn as\_slice(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Returns the remaining items of this iterator as a slice. ##### Examples ``` let vec = vec!['a', 'b', 'c']; let mut into_iter = vec.into_iter(); assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']); let _ = into_iter.next().unwrap(); assert_eq!(into_iter.as_slice(), &['b', 'c']); ``` [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#82)1.15.0 · #### pub fn as\_mut\_slice(&mut self) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Returns the remaining items of this iterator as a mutable slice. ##### Examples ``` let vec = vec!['a', 'b', 'c']; let mut into_iter = vec.into_iter(); assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']); into_iter.as_mut_slice()[2] = 'z'; assert_eq!(into_iter.next().unwrap(), 'a'); assert_eq!(into_iter.next().unwrap(), 'b'); assert_eq!(into_iter.next().unwrap(), 'z'); ``` [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#89)#### pub fn allocator(&self) -> &A 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Returns a reference to the underlying allocator. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#133)1.46.0 · ### impl<T, A> AsRef<[T]> for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#134)#### fn as\_ref(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#338)1.8.0 · ### impl<T, A> Clone for IntoIter<T, A>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#340)#### fn clone(&self) -> IntoIter<T, A> Notable traits for [IntoIter](struct.intoiter "struct std::vec::IntoIter")<T, A> ``` impl<T, A> Iterator for IntoIter<T, A>where     A: Allocator, type Item = T; ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#45)1.13.0 · ### impl<T, A> Debug for IntoIter<T, A>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#46)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#262)### impl<T, A> DoubleEndedIterator for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#264)#### fn next\_back(&mut self) -> Option<T> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#281)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#350)### impl<T, A> Drop for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#351)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#303)### impl<T, A> ExactSizeIterator for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#304)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#145)### impl<T, A> Iterator for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Item = T The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#149)#### fn next(&mut self) -> Option<T> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#169)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#179)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#202)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#207)#### fn next\_chunk<const N: usize>(&mut self) -> Result<[T; N], IntoIter<T, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)#### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)#### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#310)1.26.0 · ### impl<T, A> FusedIterator for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#140)### impl<T, A> Send for IntoIter<T, A>where T: [Send](../marker/trait.send "trait std::marker::Send"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Send](../marker/trait.send "trait std::marker::Send"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#142)### impl<T, A> Sync for IntoIter<T, A>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Sync](../marker/trait.sync "trait std::marker::Sync"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#313)### impl<T, A> TrustedLen for IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Auto Trait Implementations -------------------------- ### impl<T, A> RefUnwindSafe for IntoIter<T, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> Unpin for IntoIter<T, A>where A: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T, A> UnwindSafe for IntoIter<T, A>where A: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::vec::DrainFilter Struct std::vec::DrainFilter ============================ ``` pub struct DrainFilter<'a, T, F, A = Global>where    A: Allocator,    F: FnMut(&mut T) -> bool,{ /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`drain_filter` [#43244](https://github.com/rust-lang/rust/issues/43244)) An iterator which uses a closure to determine if an element should be removed. This struct is created by [`Vec::drain_filter`](struct.vec#method.drain_filter "Vec::drain_filter"). See its documentation for more. Example ------- ``` #![feature(drain_filter)] let mut v = vec![0, 1, 2]; let iter: std::vec::DrainFilter<_, _> = v.drain_filter(|x| *x % 2 == 0); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#48)### impl<T, F, A> DrainFilter<'\_, T, F, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#55)#### pub fn allocator(&self) -> &A 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Returns a reference to the underlying allocator. [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#80)#### pub fn keep\_rest(self) 🔬This is a nightly-only experimental API. (`drain_keep_rest` [#101122](https://github.com/rust-lang/rust/issues/101122)) Keep unyielded elements in the source `Vec`. ##### Examples ``` #![feature(drain_filter)] #![feature(drain_keep_rest)] let mut vec = vec!['a', 'b', 'c']; let mut drain = vec.drain_filter(|_| true); assert_eq!(drain.next().unwrap(), 'a'); // This call keeps 'b' and 'c' in the vec. drain.keep_rest(); // If we wouldn't call `keep_rest()`, // `vec` would be empty. assert_eq!(vec, ['b', 'c']); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#22)### impl<'a, T, F, A> Debug for DrainFilter<'a, T, F, A>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), F: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), A: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#22)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#154)### impl<T, F, A> Drop for DrainFilter<'\_, T, F, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#158)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#116)### impl<T, F, A> Iterator for DrainFilter<'\_, T, F, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), #### type Item = T The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#122)#### fn next(&mut self) -> Option<T> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#148)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)1.0.0 · #### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)1.0.0 · #### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)1.0.0 · #### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl<'a, T, F, A> RefUnwindSafe for DrainFilter<'a, T, F, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), F: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, F, A> Send for DrainFilter<'a, T, F, A>where A: [Send](../marker/trait.send "trait std::marker::Send"), F: [Send](../marker/trait.send "trait std::marker::Send"), T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<'a, T, F, A> Sync for DrainFilter<'a, T, F, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), F: [Sync](../marker/trait.sync "trait std::marker::Sync"), T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<'a, T, F, A> Unpin for DrainFilter<'a, T, F, A>where F: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<'a, T, F, A = Global> !UnwindSafe for DrainFilter<'a, T, F, A> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::vec::Splice Struct std::vec::Splice ======================= ``` pub struct Splice<'a, I, A = Global>where    I: 'a + Iterator,    A: 'a + Allocator,{ /* private fields */ } ``` A splicing iterator for `Vec`. This struct is created by [`Vec::splice()`](struct.vec#method.splice "Vec::splice()"). See its documentation for more. Example ------- ``` let mut v = vec![0, 1, 2]; let new = [7, 8]; let iter: std::vec::Splice<_> = v.splice(1.., new); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#19)### impl<'a, I, A> Debug for Splice<'a, I, A>where I: 'a + [Debug](../fmt/trait.debug "trait std::fmt::Debug") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), A: 'a + [Debug](../fmt/trait.debug "trait std::fmt::Debug") + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#19)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#44)### impl<I, A> DoubleEndedIterator for Splice<'\_, I, A>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#45)#### fn next\_back(&mut self) -> Option<<Splice<'\_, I, A> as Iterator>::Item> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#54)### impl<I, A> Drop for Splice<'\_, I, A>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#55)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#51)### impl<I, A> ExactSizeIterator for Splice<'\_, I, A>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)1.0.0 · #### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#31)### impl<I, A> Iterator for Splice<'\_, I, A>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#34)#### fn next(&mut self) -> Option<<Splice<'\_, I, A> as Iterator>::Item> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#38)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)1.0.0 · #### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)1.0.0 · #### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)#### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)1.0.0 · #### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)1.0.0 · #### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)1.0.0 · #### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl<'a, I, A> RefUnwindSafe for Splice<'a, I, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, I, A> Send for Splice<'a, I, A>where A: [Send](../marker/trait.send "trait std::marker::Send"), I: [Send](../marker/trait.send "trait std::marker::Send"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Send](../marker/trait.send "trait std::marker::Send"), ### impl<'a, I, A> Sync for Splice<'a, I, A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), I: [Sync](../marker/trait.sync "trait std::marker::Sync"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<'a, I, A> Unpin for Splice<'a, I, A>where I: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<'a, I, A> UnwindSafe for Splice<'a, I, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::vec::Drain Struct std::vec::Drain ====================== ``` pub struct Drain<'a, T, A = Global>where    T: 'a,    A: 'a + Allocator,{ /* private fields */ } ``` A draining iterator for `Vec<T>`. This `struct` is created by [`Vec::drain`](struct.vec#method.drain "Vec::drain"). See its documentation for more. Example ------- ``` let mut v = vec![0, 1, 2]; let iter: std::vec::Drain<_> = v.drain(..); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#95)### impl<T, A> Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), This impl block contains no items. Private helper methods for `Splice::drop` [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#43)### impl<'a, T, A> Drain<'a, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#57)1.46.0 · #### pub fn as\_slice(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Returns the remaining items of this iterator as a slice. ##### Examples ``` let mut vec = vec!['a', 'b', 'c']; let mut drain = vec.drain(..); assert_eq!(drain.as_slice(), &['a', 'b', 'c']); let _ = drain.next().unwrap(); assert_eq!(drain.as_slice(), &['b', 'c']); ``` [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#65)#### pub fn allocator(&self) -> &A 🔬This is a nightly-only experimental API. (`allocator_api` [#32838](https://github.com/rust-lang/rust/issues/32838)) Returns a reference to the underlying allocator. [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#89)#### pub fn keep\_rest(self) 🔬This is a nightly-only experimental API. (`drain_keep_rest` [#101122](https://github.com/rust-lang/rust/issues/101122)) Keep unyielded elements in the source `Vec`. ##### Examples ``` #![feature(drain_keep_rest)] let mut vec = vec!['a', 'b', 'c']; let mut drain = vec.drain(..); assert_eq!(drain.next().unwrap(), 'a'); // This call keeps 'b' and 'c' in the vec. drain.keep_rest(); // If we wouldn't call `keep_rest()`, // `vec` would be empty. assert_eq!(vec, ['b', 'c']); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#142)1.46.0 · ### impl<'a, T, A> AsRef<[T]> for Drain<'a, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#143)#### fn as\_ref(&self) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#37)1.17.0 · ### impl<T, A> Debug for Drain<'\_, T, A>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#38)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#168)### impl<T, A> DoubleEndedIterator for Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#170)#### fn next\_back(&mut self) -> Option<T> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#184)1.37.0 · #### fn nth\_back(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#176)### impl<T, A> Drop for Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#177)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#245)### impl<T, A> ExactSizeIterator for Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#246)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)1.0.0 · #### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#154)### impl<T, A> Iterator for Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Item = T The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#158)#### fn next(&mut self) -> Option<T> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#162)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)1.0.0 · #### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)1.0.0 · #### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)1.0.0 · #### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](../ops/trait.try "trait std::ops::Try")>::[Residual](../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../ops/trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2920-2923)1.0.0 · #### fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](../iter/trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Searches for an element in an iterator from the right, returning its index. [Read more](../iter/trait.iterator#method.rposition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)#### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)#### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)1.0.0 · #### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#255)1.26.0 · ### impl<T, A> FusedIterator for Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#151)### impl<T, A> Send for Drain<'\_, T, A>where T: [Send](../marker/trait.send "trait std::marker::Send"), A: [Send](../marker/trait.send "trait std::marker::Send") + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#149)### impl<T, A> Sync for Drain<'\_, T, A>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), A: [Sync](../marker/trait.sync "trait std::marker::Sync") + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#252)### impl<T, A> TrustedLen for Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), Auto Trait Implementations -------------------------- ### impl<'a, T, A> RefUnwindSafe for Drain<'a, T, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> Unpin for Drain<'a, T, A> ### impl<'a, T, A> UnwindSafe for Drain<'a, T, A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::clone Module std::clone ================= The `Clone` trait for types that cannot be ‘implicitly copied’. In Rust, some simple types are “implicitly copyable” and when you assign them or pass them as arguments, the receiver will get a copy, leaving the original value in place. These types do not require allocation to copy and do not have finalizers (i.e., they do not contain owned boxes or implement [`Drop`](../ops/trait.drop "Drop")), so the compiler considers them cheap and safe to copy. For other types copies must be made explicitly, by convention implementing the [`Clone`](trait.clone#tymethod.clone) trait and calling the [`clone`](trait.clone#tymethod.clone) method. Basic usage example: ``` let s = String::new(); // String type implements Clone let copy = s.clone(); // so we can clone it ``` To easily implement the Clone trait, you can also use `#[derive(Clone)]`. Example: ``` #[derive(Clone)] // we add the Clone trait to Morpheus struct struct Morpheus { blue_pill: f32, red_pill: i64, } fn main() { let f = Morpheus { blue_pill: 0.0, red_pill: 0 }; let copy = f.clone(); // and now we can clone it! } ``` Macros ------ [Clone](macro.clone "std::clone::Clone macro") Derive macro generating an impl of the trait `Clone`. Traits ------ [Clone](trait.clone "std::clone::Clone trait") A common trait for the ability to explicitly duplicate an object. rust Trait std::clone::Clone Trait std::clone::Clone ======================= ``` pub trait Clone { fn clone(&self) -> Self; fn clone_from(&mut self, source: &Self) { ... } } ``` A common trait for the ability to explicitly duplicate an object. Differs from [`Copy`](../marker/trait.copy "Copy") in that [`Copy`](../marker/trait.copy "Copy") is implicit and an inexpensive bit-wise copy, while `Clone` is always explicit and may or may not be expensive. In order to enforce these characteristics, Rust does not allow you to reimplement [`Copy`](../marker/trait.copy "Copy"), but you may reimplement `Clone` and run arbitrary code. Since `Clone` is more general than [`Copy`](../marker/trait.copy "Copy"), you can automatically make anything [`Copy`](../marker/trait.copy "Copy") be `Clone` as well. ### Derivable This trait can be used with `#[derive]` if all fields are `Clone`. The `derive`d implementation of [`Clone`](trait.clone#tymethod.clone) calls [`clone`](trait.clone#tymethod.clone) on each field. For a generic struct, `#[derive]` implements `Clone` conditionally by adding bound `Clone` on generic parameters. ``` // `derive` implements Clone for Reading<T> when T is Clone. #[derive(Clone)] struct Reading<T> { frequency: T, } ``` ### How can I implement `Clone`? Types that are [`Copy`](../marker/trait.copy "Copy") should have a trivial implementation of `Clone`. More formally: if `T: Copy`, `x: T`, and `y: &T`, then `let x = y.clone();` is equivalent to `let x = *y;`. Manual implementations should be careful to uphold this invariant; however, unsafe code must not rely on it to ensure memory safety. An example is a generic struct holding a function pointer. In this case, the implementation of `Clone` cannot be `derive`d, but can be implemented as: ``` struct Generate<T>(fn() -> T); impl<T> Copy for Generate<T> {} impl<T> Clone for Generate<T> { fn clone(&self) -> Self { *self } } ``` ### Additional implementors In addition to the [implementors listed below](#implementors), the following types also implement `Clone`: * Function item types (i.e., the distinct types defined for each function) * Function pointer types (e.g., `fn() -> i32`) * Closure types, if they capture no value from the environment or if all such captured values implement `Clone` themselves. Note that variables captured by shared reference always implement `Clone` (even if the referent doesn’t), while variables captured by mutable reference never implement `Clone`. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/clone.rs.html#123)#### fn clone(&self) -> Self Returns a copy of the value. ##### Examples ``` let hello = "Hello"; // &str implements Clone assert_eq!("Hello", hello.clone()); ``` Provided Methods ---------------- [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. `a.clone_from(&b)` is equivalent to `a = b.clone()` in functionality, but can be overridden to reuse the resources of `a` to avoid unnecessary allocations. Implementors ------------ [source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)### impl Clone for std::cmp::Ordering [source](https://doc.rust-lang.org/src/alloc/collections/mod.rs.html#80)### impl Clone for TryReserveErrorKind [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#701)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone")) · ### impl Clone for Infallible [source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl Clone for VarError [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#25)1.28.0 · ### impl Clone for Alignment [source](https://doc.rust-lang.org/src/std/io/error.rs.html#166)### impl Clone for ErrorKind [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1881)### impl Clone for SeekFrom [source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)1.7.0 · ### impl Clone for IpAddr [source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)### impl Clone for Ipv6MulticastScope [source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)### impl Clone for Shutdown [source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl Clone for std::net::SocketAddr [source](https://doc.rust-lang.org/src/core/num/mod.rs.html#954)### impl Clone for FpCategory [source](https://doc.rust-lang.org/src/core/num/error.rs.html#87)1.55.0 · ### impl Clone for IntErrorKind [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl Clone for BacktraceStyle [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/swizzle.rs.html#76)### impl Clone for Which [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#167)### impl Clone for SearchStep [source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#212)### impl Clone for std::sync::atomic::Ordering [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#611)1.12.0 · ### impl Clone for RecvTimeoutError [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#592)### impl Clone for TryRecvError [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for bool [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for char [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for f32 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for f64 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for i8 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for i16 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for i32 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for i64 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for i128 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for isize [source](https://doc.rust-lang.org/src/core/clone.rs.html#206)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for ! [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for u8 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for u16 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for u32 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for u64 [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for u128 [source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#450-454)### impl Clone for () [source](https://doc.rust-lang.org/src/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl Clone for usize [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/cpuid.rs.html#11)1.27.0 · ### impl Clone for CpuidResult [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)1.27.0 · ### impl Clone for \_\_m128 [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)### impl Clone for \_\_m128bh [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)1.27.0 · ### impl Clone for \_\_m128d [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)1.27.0 · ### impl Clone for \_\_m128i [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)1.27.0 · ### impl Clone for \_\_m256 [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)### impl Clone for \_\_m256bh [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)1.27.0 · ### impl Clone for \_\_m256d [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)1.27.0 · ### impl Clone for \_\_m256i [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)### impl Clone for \_\_m512 [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)### impl Clone for \_\_m512bh [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)### impl Clone for \_\_m512d [source](https://doc.rust-lang.org/src/core/up/up/stdarch/crates/core_arch/src/x86/mod.rs.html#8-330)### impl Clone for \_\_m512i [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#149)### impl Clone for FromBytesUntilNulError [source](https://doc.rust-lang.org/src/core/alloc/mod.rs.html#34)### impl Clone for AllocError [source](https://doc.rust-lang.org/src/alloc/alloc.rs.html#53)### impl Clone for Global [source](https://doc.rust-lang.org/src/core/alloc/layout.rs.html#37)1.28.0 · ### impl Clone for Layout [source](https://doc.rust-lang.org/src/core/alloc/layout.rs.html#463)1.50.0 · ### impl Clone for LayoutError [source](https://doc.rust-lang.org/src/std/alloc.rs.html#130)1.28.0 · ### impl Clone for System [source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Clone for TypeId [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#113)1.34.0 · ### impl Clone for TryFromSliceError [source](https://doc.rust-lang.org/src/core/ascii.rs.html#23)### impl Clone for std::ascii::EscapeDefault [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1328)1.3.0 · ### impl Clone for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#821)1.29.0 · ### impl Clone for Box<CStr, Global> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1027-1032)1.29.0 · ### impl Clone for Box<OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#1629-1634)1.29.0 · ### impl Clone for Box<Path> [source](https://doc.rust-lang.org/src/core/char/convert.rs.html#235)1.34.0 · ### impl Clone for CharTryFromError [source](https://doc.rust-lang.org/src/core/char/decode.rs.html#29)1.9.0 · ### impl Clone for DecodeUtf16Error [source](https://doc.rust-lang.org/src/core/char/mod.rs.html#378)1.20.0 · ### impl Clone for std::char::EscapeDebug [source](https://doc.rust-lang.org/src/core/char/mod.rs.html#269)### impl Clone for std::char::EscapeDefault [source](https://doc.rust-lang.org/src/core/char/mod.rs.html#148)### impl Clone for std::char::EscapeUnicode [source](https://doc.rust-lang.org/src/core/char/convert.rs.html#149)1.20.0 · ### impl Clone for ParseCharError [source](https://doc.rust-lang.org/src/core/char/mod.rs.html#412)### impl Clone for ToLowercase [source](https://doc.rust-lang.org/src/core/char/mod.rs.html#446)### impl Clone for ToUppercase [source](https://doc.rust-lang.org/src/core/char/mod.rs.html#580)1.59.0 · ### impl Clone for TryFromCharError [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3153)1.13.0 · ### impl Clone for DefaultHasher [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3091)1.7.0 · ### impl Clone for RandomState [source](https://doc.rust-lang.org/src/alloc/collections/mod.rs.html#59)1.57.0 · ### impl Clone for TryReserveError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)1.64.0 · ### impl Clone for CString [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)1.64.0 · ### impl Clone for FromBytesWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)1.64.0 · ### impl Clone for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)1.64.0 · ### impl Clone for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)1.64.0 · ### impl Clone for NulError [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#537-547)### impl Clone for OsString [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#98)### impl Clone for Error [source](https://doc.rust-lang.org/src/std/fs.rs.html#188)### impl Clone for FileTimes [source](https://doc.rust-lang.org/src/std/fs.rs.html#207)1.1.0 · ### impl Clone for FileType [source](https://doc.rust-lang.org/src/std/fs.rs.html#109)### impl Clone for Metadata [source](https://doc.rust-lang.org/src/std/fs.rs.html#183)### impl Clone for OpenOptions [source](https://doc.rust-lang.org/src/std/fs.rs.html#200)### impl Clone for Permissions [source](https://doc.rust-lang.org/src/core/hash/sip.rs.html#48)### impl Clone for SipHasher [source](https://doc.rust-lang.org/src/std/io/util.rs.html#17)### impl Clone for std::io::Empty [source](https://doc.rust-lang.org/src/std/io/util.rs.html#189)### impl Clone for Sink [source](https://doc.rust-lang.org/src/core/marker.rs.html#776)1.33.0 · ### impl Clone for PhantomPinned [source](https://doc.rust-lang.org/src/core/mem/transmutability.rs.html#21)### impl Clone for Assume [source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)### impl Clone for AddrParseError [source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)### impl Clone for Ipv4Addr [source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)### impl Clone for Ipv6Addr [source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl Clone for SocketAddrV4 [source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl Clone for SocketAddrV6 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Clone for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Clone for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Clone for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Clone for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Clone for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Clone for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Clone for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Clone for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Clone for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Clone for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Clone for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Clone for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#173)### impl Clone for ParseFloatError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#69)### impl Clone for ParseIntError [source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)1.34.0 · ### impl Clone for TryFromIntError [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Clone for RangeFull [source](https://doc.rust-lang.org/src/std/os/linux/raw.rs.html#326)1.1.0 · ### impl Clone for stat Available on **Linux** only.[source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#83)1.10.0 · ### impl Clone for std::os::unix::net::SocketAddr Available on **Unix** only.[source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#189)### impl Clone for SocketCred Available on **(Android or Linux) and Unix** only.[source](https://doc.rust-lang.org/src/std/os/unix/ucred.rs.html#13)### impl Clone for UCred Available on **Unix** only.[source](https://doc.rust-lang.org/src/std/os/windows/io/handle.rs.html#270)1.63.0 · ### impl Clone for InvalidHandleError Available on **Windows** only.[source](https://doc.rust-lang.org/src/std/os/windows/io/handle.rs.html#252)1.63.0 · ### impl Clone for NullHandleError Available on **Windows** only.[source](https://doc.rust-lang.org/src/std/path.rs.html#1567-1577)### impl Clone for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#1937)1.7.0 · ### impl Clone for StripPrefixError [source](https://doc.rust-lang.org/src/std/process.rs.html#1723)1.61.0 · ### impl Clone for ExitCode [source](https://doc.rust-lang.org/src/std/process.rs.html#1452)### impl Clone for ExitStatus [source](https://doc.rust-lang.org/src/std/process.rs.html#1585)### impl Clone for ExitStatusError [source](https://doc.rust-lang.org/src/std/process.rs.html#1096)### impl Clone for Output [source](https://doc.rust-lang.org/src/core/str/error.rs.html#139)### impl Clone for ParseBoolError [source](https://doc.rust-lang.org/src/core/str/error.rs.html#46)### impl Clone for Utf8Error [source](https://doc.rust-lang.org/src/alloc/string.rs.html#406)### impl Clone for FromUtf8Error [source](https://doc.rust-lang.org/src/alloc/string.rs.html#1964)### impl Clone for String [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#583)### impl Clone for RecvError [source](https://doc.rust-lang.org/src/std/sync/condvar.rs.html#15)1.5.0 · ### impl Clone for WaitTimeoutResult [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)1.36.0 · ### impl Clone for RawWakerVTable [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#328)1.36.0 · ### impl Clone for Waker [source](https://doc.rust-lang.org/src/std/thread/local.rs.html#372)1.26.0 · ### impl Clone for AccessError [source](https://doc.rust-lang.org/src/std/thread/mod.rs.html#1122)### impl Clone for Thread [source](https://doc.rust-lang.org/src/std/thread/mod.rs.html#1039)1.19.0 · ### impl Clone for ThreadId [source](https://doc.rust-lang.org/src/core/time.rs.html#70)1.3.0 · ### impl Clone for Duration [source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl Clone for FromFloatSecsError [source](https://doc.rust-lang.org/src/std/time.rs.html#152)1.8.0 · ### impl Clone for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#237)1.8.0 · ### impl Clone for SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#259)1.8.0 · ### impl Clone for SystemTimeError [source](https://doc.rust-lang.org/src/std/path.rs.html#505)### impl<'a> Clone for Component<'a> [source](https://doc.rust-lang.org/src/std/path.rs.html#141)### impl<'a> Clone for Prefix<'a> [source](https://doc.rust-lang.org/src/core/error.rs.html#419)### impl<'a> Clone for Source<'a> [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#473)### impl<'a> Clone for Arguments<'a> [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1203)1.36.0 · ### impl<'a> Clone for IoSlice<'a> [source](https://doc.rust-lang.org/src/std/sys_common/wtf8.rs.html#921)### impl<'a> Clone for EncodeWide<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)1.10.0 · ### impl<'a> Clone for Location<'a> [source](https://doc.rust-lang.org/src/std/path.rs.html#1086)1.28.0 · ### impl<'a> Clone for Ancestors<'a> [source](https://doc.rust-lang.org/src/std/path.rs.html#598)### impl<'a> Clone for Components<'a> [source](https://doc.rust-lang.org/src/std/path.rs.html#625)### impl<'a> Clone for std::path::Iter<'a> [source](https://doc.rust-lang.org/src/std/path.rs.html#422)### impl<'a> Clone for PrefixComponent<'a> [source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#173)1.60.0 · ### impl<'a> Clone for EscapeAscii<'a> [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#351)### impl<'a> Clone for CharSearcher<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#228)### impl<'a> Clone for Bytes<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#125)### impl<'a> Clone for CharIndices<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#29)### impl<'a> Clone for Chars<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1387)1.8.0 · ### impl<'a> Clone for EncodeUtf16<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1438)1.34.0 · ### impl<'a> Clone for std::str::EscapeDebug<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1448)1.34.0 · ### impl<'a> Clone for std::str::EscapeDefault<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1455)1.34.0 · ### impl<'a> Clone for std::str::EscapeUnicode<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1093)### impl<'a> Clone for Lines<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1133)### impl<'a> Clone for LinesAny<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1187)1.34.0 · ### impl<'a> Clone for SplitAsciiWhitespace<'a> [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1174)1.1.0 · ### impl<'a> Clone for SplitWhitespace<'a> [source](https://doc.rust-lang.org/src/core/str/lossy.rs.html#34)### impl<'a> Clone for Utf8Chunk<'a> [source](https://doc.rust-lang.org/src/core/str/lossy.rs.html#144)### impl<'a> Clone for Utf8Chunks<'a> [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#835)### impl<'a, 'b> Clone for CharSliceSearcher<'a, 'b> [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#983)### impl<'a, 'b> Clone for StrSearcher<'a, 'b> [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#783)### impl<'a, 'b, const N: usize> Clone for CharArrayRefSearcher<'a, 'b, N> [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#865)### impl<'a, F> Clone for CharPredicateSearcher<'a, F>where F: [Clone](trait.clone "trait std::clone::Clone") + [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([char](../primitive.char)) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1010-1026)1.5.0 · ### impl<'a, P> Clone for MatchIndices<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1067-1083)1.2.0 · ### impl<'a, P> Clone for Matches<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1010-1026)1.5.0 · ### impl<'a, P> Clone for RMatchIndices<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1067-1083)1.2.0 · ### impl<'a, P> Clone for RMatches<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#730-746)### impl<'a, P> Clone for std::str::RSplit<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#913-929)### impl<'a, P> Clone for RSplitN<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#790-806)### impl<'a, P> Clone for RSplitTerminator<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#730-746)### impl<'a, P> Clone for std::str::Split<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1341)1.51.0 · ### impl<'a, P> Clone for std::str::SplitInclusive<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#913-929)### impl<'a, P> Clone for SplitN<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/iter.rs.html#790-806)### impl<'a, P> Clone for SplitTerminator<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>, <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2905)1.31.0 · ### impl<'a, T> Clone for RChunksExact<'a, T> [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2145)### impl<'a, T, const N: usize> Clone for ArrayWindows<'a, T, N>where T: 'a + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#777)### impl<'a, const N: usize> Clone for CharArraySearcher<'a, N> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#536)### impl<'f> Clone for VaListImpl<'f> [source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#28)1.63.0 · ### impl<'fd> Clone for BorrowedFd<'fd> [source](https://doc.rust-lang.org/src/std/os/windows/io/handle.rs.html#39)1.63.0 · ### impl<'handle> Clone for BorrowedHandle<'handle> Available on **Windows** only.[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#29)1.63.0 · ### impl<'socket> Clone for BorrowedSocket<'socket> Available on **Windows** only.[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#62)### impl<A> Clone for Repeat<A>where A: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/option.rs.html#2172)### impl<A> Clone for std::option::IntoIter<A>where A: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/option.rs.html#2119)### impl<A> Clone for std::option::Iter<'\_, A> [source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#19)### impl<A, B> Clone for Chain<A, B>where A: [Clone](trait.clone "trait std::clone::Clone"), B: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/zip.rs.html#10)### impl<A, B> Clone for Zip<A, B>where A: [Clone](trait.clone "trait std::clone::Clone"), B: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#194)### impl<B> Clone for Cow<'\_, B>where B: [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)1.55.0 · ### impl<B, C> Clone for ControlFlow<B, C>where B: [Clone](trait.clone "trait std::clone::Clone"), C: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#237)### impl<Dyn> Clone for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/iter/sources/from_fn.rs.html#56)1.34.0 · ### impl<F> Clone for FromFn<F>where F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#69)1.43.0 · ### impl<F> Clone for OnceWith<F>where F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#73)1.28.0 · ### impl<F> Clone for RepeatWith<F>where F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#776)1.7.0 · ### impl<H> Clone for BuildHasherDefault<H> [source](https://doc.rust-lang.org/src/core/async_iter/from_iter.rs.html#13)### impl<I> Clone for FromIter<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/char/decode.rs.html#16)1.9.0 · ### impl<I> Clone for DecodeUtf16<I>where I: [Clone](trait.clone "trait std::clone::Clone") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [u16](../primitive.u16)>, [source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#16)1.1.0 · ### impl<I> Clone for Cloned<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/copied.rs.html#16)1.36.0 · ### impl<I> Clone for Copied<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/cycle.rs.html#10)### impl<I> Clone for Cycle<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/enumerate.rs.html#14)### impl<I> Clone for Enumerate<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/fuse.rs.html#14)### impl<I> Clone for Fuse<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/intersperse.rs.html#8)### impl<I> Clone for Intersperse<I>where I: [Clone](trait.clone "trait std::clone::Clone") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](trait.clone "trait std::clone::Clone"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/peekable.rs.html#12)### impl<I> Clone for Peekable<I>where I: [Clone](trait.clone "trait std::clone::Clone") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/skip.rs.html#12)### impl<I> Clone for Skip<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#12)1.28.0 · ### impl<I> Clone for StepBy<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/take.rs.html#12)### impl<I> Clone for Take<I>where I: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/filter_map.rs.html#14)### impl<I, F> Clone for FilterMap<I, F>where I: [Clone](trait.clone "trait std::clone::Clone"), F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/inspect.rs.html#15)### impl<I, F> Clone for Inspect<I, F>where I: [Clone](trait.clone "trait std::clone::Clone"), F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/map.rs.html#60)### impl<I, F> Clone for Map<I, F>where I: [Clone](trait.clone "trait std::clone::Clone"), F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/intersperse.rs.html#91)### impl<I, G> Clone for IntersperseWith<I, G>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator") + [Clone](trait.clone "trait std::clone::Clone"), G: [Clone](trait.clone "trait std::clone::Clone"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/filter.rs.html#14)### impl<I, P> Clone for Filter<I, P>where I: [Clone](trait.clone "trait std::clone::Clone"), P: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/map_while.rs.html#14)1.57.0 · ### impl<I, P> Clone for MapWhile<I, P>where I: [Clone](trait.clone "trait std::clone::Clone"), P: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/skip_while.rs.html#14)### impl<I, P> Clone for SkipWhile<I, P>where I: [Clone](trait.clone "trait std::clone::Clone"), P: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/take_while.rs.html#14)### impl<I, P> Clone for TakeWhile<I, P>where I: [Clone](trait.clone "trait std::clone::Clone"), P: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/scan.rs.html#14)### impl<I, St, F> Clone for Scan<I, St, F>where I: [Clone](trait.clone "trait std::clone::Clone"), St: [Clone](trait.clone "trait std::clone::Clone"), F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#192)1.29.0 · ### impl<I, U> Clone for Flatten<I>where I: [Clone](trait.clone "trait std::clone::Clone") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), U: [Clone](trait.clone "trait std::clone::Clone") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), <<I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](../iter/trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter") == U, <<I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item") == <U as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), [source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#23)### impl<I, U, F> Clone for FlatMap<I, U, F>where I: [Clone](trait.clone "trait std::clone::Clone"), F: [Clone](trait.clone "trait std::clone::Clone"), U: [Clone](trait.clone "trait std::clone::Clone") + [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), <U as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](../iter/trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/array_chunks.rs.html#12)### impl<I, const N: usize> Clone for std::iter::ArrayChunks<I, N>where I: [Clone](trait.clone "trait std::clone::Clone") + [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Clone for std::ops::Range<Idx>where Idx: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> Clone for RangeFrom<Idx>where Idx: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)1.26.0 · ### impl<Idx> Clone for RangeInclusive<Idx>where Idx: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> Clone for RangeTo<Idx>where Idx: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)1.26.0 · ### impl<Idx> Clone for RangeToInclusive<Idx>where Idx: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1490-1495)### impl<K> Clone for std::collections::hash\_set::Iter<'\_, K> [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1537)### impl<K, V> Clone for std::collections::btree\_map::Iter<'\_, K, V> [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1768)### impl<K, V> Clone for std::collections::btree\_map::Keys<'\_, K, V> [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2072)1.17.0 · ### impl<K, V> Clone for std::collections::btree\_map::Range<'\_, K, V> [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1809)### impl<K, V> Clone for std::collections::btree\_map::Values<'\_, K, V> [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1399-1404)### impl<K, V> Clone for std::collections::hash\_map::Iter<'\_, K, V> [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1498-1503)### impl<K, V> Clone for std::collections::hash\_map::Keys<'\_, K, V> [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1536-1541)### impl<K, V> Clone for std::collections::hash\_map::Values<'\_, K, V> [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#206)### impl<K, V, A> Clone for BTreeMap<K, V, A>where K: [Clone](trait.clone "trait std::clone::Clone"), V: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1259-1274)### impl<K, V, S> Clone for HashMap<K, V, S>where K: [Clone](trait.clone "trait std::clone::Clone"), V: [Clone](trait.clone "trait std::clone::Clone"), S: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/pin.rs.html#407)1.33.0 · ### impl<P> Clone for Pin<P>where P: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#1539-1543)### impl<Ret, T> Clone for fn (T₁, T₂, …, Tₙ) -> Ret This trait is implemented on function pointers with any number of arguments. [source](https://doc.rust-lang.org/src/core/clone.rs.html#244)### impl<T> !Clone for &mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Shared references can be cloned, but mutable references *cannot*! [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)1.17.0 · ### impl<T> Clone for Bound<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/option.rs.html#1889)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T> Clone for Option<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)1.36.0 · ### impl<T> Clone for Poll<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/clone.rs.html#215)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T> Clone for \*const Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/clone.rs.html#224)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T> Clone for \*mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/clone.rs.html#234)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T> Clone for &Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Shared references can be cloned, but mutable references *cannot*! [source](https://doc.rust-lang.org/src/core/cell.rs.html#260)### impl<T> Clone for Cell<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/cell/once.rs.html#254)### impl<T> Clone for OnceCell<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1158)### impl<T> Clone for RefCell<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/cmp.rs.html#646)1.19.0 · ### impl<T> Clone for Reverse<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1369)### impl<T> Clone for std::collections::binary\_heap::IntoIter<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1441)### impl<T> Clone for IntoIterSorted<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1317)### impl<T> Clone for std::collections::binary\_heap::Iter<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1486)### impl<T> Clone for std::collections::btree\_set::Iter<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1560)1.17.0 · ### impl<T> Clone for std::collections::btree\_set::Range<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1665)### impl<T> Clone for std::collections::btree\_set::SymmetricDifference<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1760)### impl<T> Clone for std::collections::btree\_set::Union<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1149)### impl<T> Clone for std::collections::linked\_list::Cursor<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#134)### impl<T> Clone for std::collections::linked\_list::IntoIter<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#93)### impl<T> Clone for std::collections::linked\_list::Iter<'\_, T> [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#333)### impl<T> Clone for BinaryHeap<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1918)### impl<T> Clone for LinkedList<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/iter.rs.html#45)### impl<T> Clone for std::collections::vec\_deque::Iter<'\_, T> [source](https://doc.rust-lang.org/src/core/future/pending.rs.html#54)1.48.0 · ### impl<T> Clone for Pending<T> [source](https://doc.rust-lang.org/src/core/future/ready.rs.html#10)1.48.0 · ### impl<T> Clone for Ready<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/std/io/cursor.rs.html#264-278)### impl<T> Clone for std::io::Cursor<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/sources/empty.rs.html#80)1.2.0 · ### impl<T> Clone for std::iter::Empty<T> [source](https://doc.rust-lang.org/src/core/iter/sources/once.rs.html#62)1.2.0 · ### impl<T> Clone for Once<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/adapters/rev.rs.html#11)### impl<T> Clone for Rev<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/marker.rs.html#680)### impl<T> Clone for PhantomData<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/mem/mod.rs.html#1084)1.21.0 · ### impl<T> Clone for Discriminant<T> [source](https://doc.rust-lang.org/src/core/mem/manually_drop.rs.html#48)1.20.0 · ### impl<T> Clone for ManuallyDrop<T>where T: [Clone](trait.clone "trait std::clone::Clone") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Clone for Saturating<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Clone for Wrapping<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#701)1.25.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone")) · ### impl<T> Clone for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1574)### impl<T> Clone for Rc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2510)1.4.0 · ### impl<T> Clone for std::rc::Weak<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/result.rs.html#1981)### impl<T> Clone for std::result::IntoIter<T>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/result.rs.html#1925)### impl<T> Clone for std::result::Iter<'\_, T> [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1461)### impl<T> Clone for Chunks<'\_, T> [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1847)1.31.0 · ### impl<T> Clone for ChunksExact<'\_, T> [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#148)### impl<T> Clone for std::slice::Iter<'\_, T> [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2525)1.31.0 · ### impl<T> Clone for RChunks<'\_, T> [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1313)### impl<T> Clone for Windows<'\_, T> [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#843-890)### impl<T> Clone for Sender<T> [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1017-1022)### impl<T> Clone for SyncSender<T> [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#1327)### impl<T> Clone for Arc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2120)1.4.0 · ### impl<T> Clone for std::sync::Weak<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/mem/maybe_uninit.rs.html#256)1.36.0 · ### impl<T> Clone for MaybeUninit<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1974)1.3.0 · ### impl<T, A> Clone for Box<[T], A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1278)### impl<T, A> Clone for Box<T, A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1598)### impl<T, A> Clone for std::collections::btree\_set::Difference<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1700)### impl<T, A> Clone for std::collections::btree\_set::Intersection<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#120)### impl<T, A> Clone for BTreeSet<T, A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#113)### impl<T, A> Clone for VecDeque<T, A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/into_iter.rs.html#15)### impl<T, A> Clone for std::collections::vec\_deque::IntoIter<T, A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Clone](trait.clone "trait std::clone::Clone") + [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#338)1.8.0 · ### impl<T, A> Clone for std::vec::IntoIter<T, A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2576)### impl<T, A> Clone for Vec<T, A>where T: [Clone](trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/result.rs.html#1806)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T, E> Clone for Result<T, E>where T: [Clone](trait.clone "trait std::clone::Clone"), E: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/iter/sources/successors.rs.html#31)1.34.0 · ### impl<T, F> Clone for Successors<T, F>where T: [Clone](trait.clone "trait std::clone::Clone"), F: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#941)1.27.0 · ### impl<T, P> Clone for std::slice::RSplit<'\_, T, P>where P: [Clone](trait.clone "trait std::clone::Clone") + [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#437)### impl<T, P> Clone for std::slice::Split<'\_, T, P>where P: [Clone](trait.clone "trait std::clone::Clone") + [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#570)1.51.0 · ### impl<T, P> Clone for std::slice::SplitInclusive<'\_, T, P>where P: [Clone](trait.clone "trait std::clone::Clone") + [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1669-1674)### impl<T, S> Clone for std::collections::hash\_set::Difference<'\_, T, S> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#972-986)### impl<T, S> Clone for HashSet<T, S>where T: [Clone](trait.clone "trait std::clone::Clone"), S: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1617-1622)### impl<T, S> Clone for std::collections::hash\_set::Intersection<'\_, T, S> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1721-1726)### impl<T, S> Clone for std::collections::hash\_set::SymmetricDifference<'\_, T, S> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1766-1771)### impl<T, S> Clone for std::collections::hash\_set::Union<'\_, T, S> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#100)### impl<T, const LANES: usize> Clone for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/vector.rs.html#478)### impl<T, const LANES: usize> Clone for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#350)1.58.0 · ### impl<T, const N: usize> Clone for [T; N]where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/array/iter.rs.html#395)1.40.0 · ### impl<T, const N: usize> Clone for std::array::IntoIter<T, N>where T: [Clone](trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2295)### impl<T, const N: usize> Clone for std::slice::ArrayChunks<'\_, T, N> [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#629)### impl<T: Clone> Clone for TrySendError<T> [source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#1046-1050)### impl<T: Clone> Clone for (T₁, T₂, …, Tₙ) This trait is implemented on arbitrary-length tuples. [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#573)### impl<T: Clone> Clone for SendError<T> [source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#377-388)### impl<T: Clone> Clone for OnceLock<T> [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Clone for GeneratorState<Y, R>where Y: [Clone](trait.clone "trait std::clone::Clone"), R: [Clone](trait.clone "trait std::clone::Clone"),
programming_docs
rust Macro std::clone::Clone Macro std::clone::Clone ======================= ``` pub macro Clone($item:item) { ... } ``` Derive macro generating an impl of the trait `Clone`. rust Type Definition std::ffi::c_int Type Definition std::ffi::c\_int ================================ ``` pub type c_int = i32; ``` Equivalent to C’s `signed int` (`int`) type. This type will almost always be [`i32`](../primitive.i32 "i32"), but may differ on some esoteric systems. The C standard technically only requires that this type be a signed integer that is at least the size of a [`short`](type.c_short); some systems define it as an [`i16`](../primitive.i16 "i16"), for example. rust Type Definition std::ffi::c_double Type Definition std::ffi::c\_double =================================== ``` pub type c_double = f64; ``` Equivalent to C’s `double` type. This type will almost always be [`f64`](../primitive.f64 "f64"), which is guaranteed to be an [IEEE 754 double-precision float](https://en.wikipedia.org/wiki/IEEE_754) in Rust. That said, the standard technically only guarantees that it be a floating-point number with at least the precision of a [`float`](type.c_float), and it may be `f32` or something entirely different from the IEEE-754 standard. rust Type Definition std::ffi::c_char Type Definition std::ffi::c\_char ================================= ``` pub type c_char = i8; ``` Equivalent to C’s `char` type. [C’s `char` type](https://en.wikipedia.org/wiki/C_data_types#Basic_types) is completely unlike [Rust’s `char` type](../primitive.char); while Rust’s type represents a unicode scalar value, C’s `char` type is just an ordinary integer. On modern architectures this type will always be either [`i8`](../primitive.i8 "i8") or [`u8`](../primitive.u8 "u8"), as they use byte-addresses memory with 8-bit bytes. C chars are most commonly used to make C strings. Unlike Rust, where the length of a string is included alongside the string, C strings mark the end of a string with the character `'\0'`. See `CStr` for more information. rust Type Definition std::ffi::c_short Type Definition std::ffi::c\_short ================================== ``` pub type c_short = i16; ``` Equivalent to C’s `signed short` (`short`) type. This type will almost always be [`i16`](../primitive.i16 "i16"), but may differ on some esoteric systems. The C standard technically only requires that this type be a signed integer with at least 16 bits; some systems may define it as `i32`, for example. rust Module std::ffi Module std::ffi =============== Utilities related to FFI bindings. This module provides utilities to handle data across non-Rust interfaces, like other programming languages and the underlying operating system. It is mainly of use for FFI (Foreign Function Interface) bindings and code that needs to exchange C-like strings with other languages. Overview -------- Rust represents owned strings with the [`String`](../string/struct.string "String") type, and borrowed slices of strings with the [`str`](../primitive.str "str") primitive. Both are always in UTF-8 encoding, and may contain nul bytes in the middle, i.e., if you look at the bytes that make up the string, there may be a `\0` among them. Both `String` and `str` store their length explicitly; there are no nul terminators at the end of strings like in C. C strings are different from Rust strings: * **Encodings** - Rust strings are UTF-8, but C strings may use other encodings. If you are using a string from C, you should check its encoding explicitly, rather than just assuming that it is UTF-8 like you can do in Rust. * **Character size** - C strings may use `char` or `wchar_t`-sized characters; please **note** that C’s `char` is different from Rust’s. The C standard leaves the actual sizes of those types open to interpretation, but defines different APIs for strings made up of each character type. Rust strings are always UTF-8, so different Unicode characters will be encoded in a variable number of bytes each. The Rust type [`char`](../primitive.char "char") represents a ‘[Unicode scalar value](https://www.unicode.org/glossary/#unicode_scalar_value)’, which is similar to, but not the same as, a ‘[Unicode code point](https://www.unicode.org/glossary/#code_point)’. * **Nul terminators and implicit string lengths** - Often, C strings are nul-terminated, i.e., they have a `\0` character at the end. The length of a string buffer is not stored, but has to be calculated; to compute the length of a string, C code must manually call a function like `strlen()` for `char`-based strings, or `wcslen()` for `wchar_t`-based ones. Those functions return the number of characters in the string excluding the nul terminator, so the buffer length is really `len+1` characters. Rust strings don’t have a nul terminator; their length is always stored and does not need to be calculated. While in Rust accessing a string’s length is an *O*(1) operation (because the length is stored); in C it is an *O*(*n*) operation because the length needs to be computed by scanning the string for the nul terminator. * **Internal nul characters** - When C strings have a nul terminator character, this usually means that they cannot have nul characters in the middle — a nul character would essentially truncate the string. Rust strings *can* have nul characters in the middle, because nul does not have to mark the end of the string in Rust. Representations of non-Rust strings ----------------------------------- [`CString`](struct.cstring "CString") and [`CStr`](struct.cstr "CStr") are useful when you need to transfer UTF-8 strings to and from languages with a C ABI, like Python. * **From Rust to C:** [`CString`](struct.cstring "CString") represents an owned, C-friendly string: it is nul-terminated, and has no internal nul characters. Rust code can create a [`CString`](struct.cstring "CString") out of a normal string (provided that the string doesn’t have nul characters in the middle), and then use a variety of methods to obtain a raw `*mut [u8](../primitive.u8 "u8")` that can then be passed as an argument to functions which use the C conventions for strings. * **From C to Rust:** [`CStr`](struct.cstr "CStr") represents a borrowed C string; it is what you would use to wrap a raw `*const [u8](../primitive.u8 "u8")` that you got from a C function. A [`CStr`](struct.cstr "CStr") is guaranteed to be a nul-terminated array of bytes. Once you have a [`CStr`](struct.cstr "CStr"), you can convert it to a Rust `&[str](../primitive.str "str")` if it’s valid UTF-8, or lossily convert it by adding replacement characters. [`OsString`](struct.osstring "OsString") and [`OsStr`](struct.osstr "OsStr") are useful when you need to transfer strings to and from the operating system itself, or when capturing the output of external commands. Conversions between [`OsString`](struct.osstring "OsString"), [`OsStr`](struct.osstr "OsStr") and Rust strings work similarly to those for [`CString`](struct.cstring "CString") and [`CStr`](struct.cstr "CStr"). * [`OsString`](struct.osstring "OsString") losslessly represents an owned platform string. However, this representation is not necessarily in a form native to the platform. In the Rust standard library, various APIs that transfer strings to/from the operating system use [`OsString`](struct.osstring "OsString") instead of plain strings. For example, [`env::var_os()`](../env/fn.var_os "env::var_os") is used to query environment variables; it returns an `[Option](../option/enum.option "Option")<[OsString](struct.osstring "OsString")>`. If the environment variable exists you will get a `[Some](../option/enum.option#variant.Some "Some")(os_string)`, which you can *then* try to convert to a Rust string. This yields a [`Result`](../result/enum.result "Result"), so that your code can detect errors in case the environment variable did not in fact contain valid Unicode data. * [`OsStr`](struct.osstr "OsStr") losslessly represents a borrowed reference to a platform string. However, this representation is not necessarily in a form native to the platform. It can be converted into a UTF-8 Rust string slice in a similar way to [`OsString`](struct.osstring "OsString"). Conversions ----------- ### On Unix On Unix, [`OsStr`](struct.osstr "OsStr") implements the `std::os::unix::ffi::[OsStrExt](../os/unix/ffi/trait.osstrext "os::unix::ffi::OsStrExt")` trait, which augments it with two methods, [`from_bytes`](../os/unix/ffi/trait.osstrext#tymethod.from_bytes "os::unix::ffi::OsStrExt::from_bytes") and [`as_bytes`](../os/unix/ffi/trait.osstrext#tymethod.as_bytes "os::unix::ffi::OsStrExt::as_bytes"). These do inexpensive conversions from and to byte slices. Additionally, on Unix [`OsString`](struct.osstring "OsString") implements the `std::os::unix::ffi::[OsStringExt](../os/unix/ffi/trait.osstringext "os::unix::ffi::OsStringExt")` trait, which provides [`from_vec`](../os/unix/ffi/trait.osstringext#tymethod.from_vec "os::unix::ffi::OsStringExt::from_vec") and [`into_vec`](../os/unix/ffi/trait.osstringext#tymethod.into_vec "os::unix::ffi::OsStringExt::into_vec") methods that consume their arguments, and take or produce vectors of [`u8`](../primitive.u8 "u8"). ### On Windows An [`OsStr`](struct.osstr "OsStr") can be losslessly converted to a native Windows string. And a native Windows string can be losslessly converted to an [`OsString`](struct.osstring "OsString"). On Windows, [`OsStr`](struct.osstr "OsStr") implements the `std::os::windows::ffi::[OsStrExt](../os/windows/ffi/trait.osstrext "os::windows::ffi::OsStrExt")` trait, which provides an [`encode_wide`](../os/windows/ffi/trait.osstrext#tymethod.encode_wide "os::windows::ffi::OsStrExt::encode_wide") method. This provides an iterator that can be [`collect`](../iter/trait.iterator#method.collect "iter::Iterator::collect")ed into a vector of [`u16`](../primitive.u16 "u16"). After a nul characters is appended, this is the same as a native Windows string. Additionally, on Windows [`OsString`](struct.osstring "OsString") implements the `std::os::windows:ffi::[OsStringExt](../os/windows/ffi/trait.osstringext "os::windows::ffi::OsStringExt")` trait, which provides a [`from_wide`](../os/windows/ffi/trait.osstringext#tymethod.from_wide "os::windows::ffi::OsStringExt::from_wide") method to convert a native Windows string (without the terminating nul character) to an [`OsString`](struct.osstring "OsString"). Structs ------- [VaList](struct.valist "std::ffi::VaList struct")Experimental A wrapper for a `va_list` [VaListImpl](struct.valistimpl "std::ffi::VaListImpl struct")Experimental x86\_64 ABI implementation of a `va_list`. [CStr](struct.cstr "std::ffi::CStr struct") Representation of a borrowed C string. [CString](struct.cstring "std::ffi::CString struct") A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the middle. [FromBytesWithNulError](struct.frombyteswithnulerror "std::ffi::FromBytesWithNulError struct") An error indicating that a nul byte was not in the expected position. [FromVecWithNulError](struct.fromvecwithnulerror "std::ffi::FromVecWithNulError struct") An error indicating that a nul byte was not in the expected position. [IntoStringError](struct.intostringerror "std::ffi::IntoStringError struct") An error indicating invalid UTF-8 when converting a [`CString`](struct.cstring "CString") into a [`String`](../string/struct.string "String"). [NulError](struct.nulerror "std::ffi::NulError struct") An error indicating that an interior nul byte was found. [OsStr](struct.osstr "std::ffi::OsStr struct") Borrowed reference to an OS string (see [`OsString`](struct.osstring "OsString")). [OsString](struct.osstring "std::ffi::OsString struct") A type that can represent owned, mutable platform-native strings, but is cheaply inter-convertible with Rust strings. Enums ----- [c\_void](enum.c_void "std::ffi::c_void enum") Equivalent to C’s `void` type when used as a [pointer](../primitive.pointer "pointer"). Type Definitions ---------------- [c\_char](type.c_char "std::ffi::c_char type") Equivalent to C’s `char` type. [c\_double](type.c_double "std::ffi::c_double type") Equivalent to C’s `double` type. [c\_float](type.c_float "std::ffi::c_float type") Equivalent to C’s `float` type. [c\_int](type.c_int "std::ffi::c_int type") Equivalent to C’s `signed int` (`int`) type. [c\_long](type.c_long "std::ffi::c_long type") Equivalent to C’s `signed long` (`long`) type. [c\_longlong](type.c_longlong "std::ffi::c_longlong type") Equivalent to C’s `signed long long` (`long long`) type. [c\_schar](type.c_schar "std::ffi::c_schar type") Equivalent to C’s `signed char` type. [c\_short](type.c_short "std::ffi::c_short type") Equivalent to C’s `signed short` (`short`) type. [c\_uchar](type.c_uchar "std::ffi::c_uchar type") Equivalent to C’s `unsigned char` type. [c\_uint](type.c_uint "std::ffi::c_uint type") Equivalent to C’s `unsigned int` type. [c\_ulong](type.c_ulong "std::ffi::c_ulong type") Equivalent to C’s `unsigned long` type. [c\_ulonglong](type.c_ulonglong "std::ffi::c_ulonglong type") Equivalent to C’s `unsigned long long` type. [c\_ushort](type.c_ushort "std::ffi::c_ushort type") Equivalent to C’s `unsigned short` type. rust Struct std::ffi::OsStr Struct std::ffi::OsStr ====================== ``` pub struct OsStr { /* private fields */ } ``` Borrowed reference to an OS string (see [`OsString`](struct.osstring "OsString")). This type represents a borrowed reference to a string in the operating system’s preferred representation. `&OsStr` is to [`OsString`](struct.osstring "OsString") as `&[str](../primitive.str "str")` is to [`String`](../string/struct.string "String"): the former in each pair are borrowed references; the latter are owned strings. See the [module’s toplevel documentation about conversions](index#conversions) for a discussion on the traits which `OsStr` implements for [conversions](index#conversions) from/to native representations. Implementations --------------- [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#655-982)### impl OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#667-669)#### pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr Coerces into an `OsStr` slice. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new("foo"); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#703-705)#### pub fn to\_str(&self) -> Option<&str> Yields a `&[str](../primitive.str "str")` slice if the `OsStr` is valid Unicode. This conversion may entail doing a check for UTF-8 validity. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new("foo"); assert_eq!(os_str.to_str(), Some("foo")); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#756-758)#### pub fn to\_string\_lossy(&self) -> Cow<'\_, str> Converts an `OsStr` to a `[Cow](../borrow/enum.cow "Cow")<[str](../primitive.str "str")>`. Any non-Unicode sequences are replaced with [`U+FFFD REPLACEMENT CHARACTER`](../char/constant.replacement_character). ##### Examples Calling `to_string_lossy` on an `OsStr` with invalid unicode: ``` // Note, due to differences in how Unix and Windows represent strings, // we are forced to complicate this example, setting up example `OsStr`s // with different source data and via different platform extensions. // Understand that in reality you could end up with such example invalid // sequences simply through collecting user command line arguments, for // example. #[cfg(unix)] { use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; // Here, the values 0x66 and 0x6f correspond to 'f' and 'o' // respectively. The value 0x80 is a lone continuation byte, invalid // in a UTF-8 sequence. let source = [0x66, 0x6f, 0x80, 0x6f]; let os_str = OsStr::from_bytes(&source[..]); assert_eq!(os_str.to_string_lossy(), "fo�o"); } #[cfg(windows)] { use std::ffi::OsString; use std::os::windows::prelude::*; // Here the values 0x0066 and 0x006f correspond to 'f' and 'o' // respectively. The value 0xD800 is a lone surrogate half, invalid // in a UTF-16 sequence. let source = [0x0066, 0x006f, 0xD800, 0x006f]; let os_string = OsString::from_wide(&source[..]); let os_str = os_string.as_os_str(); assert_eq!(os_str.to_string_lossy(), "fo�o"); } ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#775-777)#### pub fn to\_os\_string(&self) -> OsString Copies the slice into an owned [`OsString`](struct.osstring "OsString"). ##### Examples ``` use std::ffi::{OsStr, OsString}; let os_str = OsStr::new("foo"); let os_string = os_str.to_os_string(); assert_eq!(os_string, OsString::from("foo")); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#795-797)1.9.0 · #### pub fn is\_empty(&self) -> bool Checks whether the `OsStr` is empty. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new(""); assert!(os_str.is_empty()); let os_str = OsStr::new("foo"); assert!(!os_str.is_empty()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#829-831)1.9.0 · #### pub fn len(&self) -> usize Returns the length of this `OsStr`. Note that this does **not** return the number of bytes in the string in OS string form. The length returned is that of the underlying storage used by `OsStr`. As discussed in the [`OsString`](struct.osstring "OsString") introduction, [`OsString`](struct.osstring "OsString") and `OsStr` store strings in a form best suited for cheap inter-conversion between native-platform and Rust string forms, which may differ significantly from both of them, including in storage size and encoding. This number is simply useful for passing to other methods, like [`OsString::with_capacity`](struct.osstring#method.with_capacity "OsString::with_capacity") to avoid reallocations. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new(""); assert_eq!(os_str.len(), 0); let os_str = OsStr::new("foo"); assert_eq!(os_str.len(), 3); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#836-839)1.20.0 · #### pub fn into\_os\_string(self: Box<OsStr>) -> OsString Converts a `[Box](../boxed/struct.box "Box")<[OsStr](struct.osstr "OsStr")>` into an [`OsString`](struct.osstring "OsString") without copying or allocating. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#871-873)1.53.0 · #### pub fn make\_ascii\_lowercase(&mut self) Converts this string to its ASCII lower case equivalent in-place. ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged. To return a new lowercased value without modifying the existing one, use [`OsStr::to_ascii_lowercase`](struct.osstr#method.to_ascii_lowercase "OsStr::to_ascii_lowercase"). ##### Examples ``` use std::ffi::OsString; let mut s = OsString::from("GRÜßE, JÜRGEN ❤"); s.make_ascii_lowercase(); assert_eq!("grÜße, jÜrgen ❤", s); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#896-898)1.53.0 · #### pub fn make\_ascii\_uppercase(&mut self) Converts this string to its ASCII upper case equivalent in-place. ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged. To return a new uppercased value without modifying the existing one, use [`OsStr::to_ascii_uppercase`](struct.osstr#method.to_ascii_uppercase "OsStr::to_ascii_uppercase"). ##### Examples ``` use std::ffi::OsString; let mut s = OsString::from("Grüße, Jürgen ❤"); s.make_ascii_uppercase(); assert_eq!("GRüßE, JüRGEN ❤", s); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#918-920)1.53.0 · #### pub fn to\_ascii\_lowercase(&self) -> OsString Returns a copy of this string where each character is mapped to its ASCII lower case equivalent. ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged. To lowercase the value in-place, use [`OsStr::make_ascii_lowercase`](struct.osstr#method.make_ascii_lowercase "OsStr::make_ascii_lowercase"). ##### Examples ``` use std::ffi::OsString; let s = OsString::from("Grüße, Jürgen ❤"); assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#940-942)1.53.0 · #### pub fn to\_ascii\_uppercase(&self) -> OsString Returns a copy of this string where each character is mapped to its ASCII upper case equivalent. ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged. To uppercase the value in-place, use [`OsStr::make_ascii_uppercase`](struct.osstr#method.make_ascii_uppercase "OsStr::make_ascii_uppercase"). ##### Examples ``` use std::ffi::OsString; let s = OsString::from("Grüße, Jürgen ❤"); assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#960-962)1.53.0 · #### pub fn is\_ascii(&self) -> bool Checks if all characters in this string are within the ASCII range. ##### Examples ``` use std::ffi::OsString; let ascii = OsString::from("hello!\n"); let non_ascii = OsString::from("Grüße, Jürgen ❤"); assert!(ascii.is_ascii()); assert!(!non_ascii.is_ascii()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#979-981)1.53.0 · #### pub fn eq\_ignore\_ascii\_case<S: AsRef<OsStr>>(&self, other: S) -> bool Checks that two strings are an ASCII case-insensitive match. Same as `to_ascii_lowercase(a) == to_ascii_lowercase(b)`, but without allocating and copying temporaries. ##### Examples ``` use std::ffi::OsString; assert!(OsString::from("Ferris").eq_ignore_ascii_case("FERRIS")); assert!(OsString::from("Ferrös").eq_ignore_ascii_case("FERRöS")); assert!(!OsString::from("Ferrös").eq_ignore_ascii_case("FERRÖS")); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/path.rs.html#565-570)### impl AsRef<OsStr> for Component<'\_> [source](https://doc.rust-lang.org/src/std/path.rs.html#567-569)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/path.rs.html#806-811)### impl AsRef<OsStr> for Components<'\_> [source](https://doc.rust-lang.org/src/std/path.rs.html#808-810)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/path.rs.html#859-864)### impl AsRef<OsStr> for Iter<'\_> [source](https://doc.rust-lang.org/src/std/path.rs.html#861-863)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1303-1308)### impl AsRef<OsStr> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1305-1307)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1311-1316)### impl AsRef<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1313-1315)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/path.rs.html#2869-2874)### impl AsRef<OsStr> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#2871-2873)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/path.rs.html#1880-1885)### impl AsRef<OsStr> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#1882-1884)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1327-1332)### impl AsRef<OsStr> for String [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1329-1331)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1319-1324)### impl AsRef<OsStr> for str [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1321-1323)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/path.rs.html#3009-3014)### impl AsRef<Path> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3011-3013)#### fn as\_ref(&self) -> &Path Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1282-1287)### impl Borrow<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1284-1286)#### fn borrow(&self) -> &OsStr Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1027-1032)1.29.0 · ### impl Clone for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1029-1031)#### fn clone(&self) -> Self Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1252-1256)### impl Debug for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1253-1255)#### fn fmt(&self, formatter: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1123-1129)1.9.0 · ### impl Default for &OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1126-1128)#### fn default() -> Self Creates an empty `OsStr`. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1114-1120)1.17.0 · ### impl Default for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1116-1119)#### fn default() -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1376-1383)1.52.0 · ### impl<'a> Extend<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1378-1382)#### fn extend<T: IntoIterator<Item = &'a OsStr>>(&mut self, iter: T) Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#371)#### fn extend\_one(&mut self, item: A) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1086-1092)1.28.0 · ### impl<'a> From<&'a OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1089-1091)#### fn from(s: &'a OsStr) -> Cow<'a, OsStr> Converts the string reference into a [`Cow::Borrowed`](../borrow/enum.cow#variant.Borrowed "Cow::Borrowed"). [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1046-1053)1.24.0 · ### impl From<&OsStr> for Arc<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1049-1052)#### fn from(s: &OsStr) -> Arc<OsStr> Copies the string into a newly allocated `[Arc](../sync/struct.arc "Arc")<[OsStr](struct.osstr "OsStr")>`. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#985-992)1.17.0 · ### impl From<&OsStr> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#988-991)#### fn from(s: &OsStr) -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Copies the string into a newly allocated `[Box](../boxed/struct.box "Box")<[OsStr](struct.osstr "OsStr")>`. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1067-1074)1.24.0 · ### impl From<&OsStr> for Rc<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1070-1073)#### fn from(s: &OsStr) -> Rc<OsStr> Copies the string into a newly allocated `[Rc](../rc/struct.rc "Rc")<[OsStr](struct.osstr "OsStr")>`. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#995-1005)1.45.0 · ### impl From<Cow<'\_, OsStr>> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#999-1004)#### fn from(cow: Cow<'\_, OsStr>) -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'a, OsStr>` into a `[Box](../boxed/struct.box "Box")<[OsStr](struct.osstr "OsStr")>`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1018-1024)1.20.0 · ### impl From<OsString> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1021-1023)#### fn from(s: OsString) -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts an [`OsString`](struct.osstring "OsString") into a `[Box](../boxed/struct.box "Box")<[OsStr](struct.osstr "OsStr")>` without copying or allocating. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1415-1424)1.52.0 · ### impl<'a> FromIterator<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1417-1423)#### fn from\_iter<I: IntoIterator<Item = &'a OsStr>>(iter: I) -> Self Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1244-1249)### impl Hash for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1246-1248)#### fn hash<H: Hasher>(&self, state: &mut H) Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1265-1279)### impl<S: Borrow<OsStr>> Join<&OsStr> for [S] #### type Output = OsString 🔬This is a nightly-only experimental API. (`slice_concat_trait` [#27747](https://github.com/rust-lang/rust/issues/27747)) The resulting type after concatenation [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1268-1278)#### fn join(slice: &Self, sep: &OsStr) -> OsString 🔬This is a nightly-only experimental API. (`slice_concat_trait` [#27747](https://github.com/rust-lang/rust/issues/27747)) Implementation of [`[T]::join`](../primitive.slice#method.join) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1194-1199)### impl Ord for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1196-1198)#### fn cmp(&self, other: &OsStr) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/std/os/unix/ffi/os_str.rs.html#61-70)### impl OsStrExt for OsStr Available on **Unix** only. [source](https://doc.rust-lang.org/src/std/os/unix/ffi/os_str.rs.html#63-65)#### fn from\_bytes(slice: &[u8]) -> &OsStr Creates an [`OsStr`](struct.osstr "OsStr") from a byte slice. [Read more](../os/unix/ffi/trait.osstrext#tymethod.from_bytes) [source](https://doc.rust-lang.org/src/std/os/unix/ffi/os_str.rs.html#67-69)#### fn as\_bytes(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Gets the underlying byte view of the [`OsStr`](struct.osstr "OsStr") slice. [Read more](../os/unix/ffi/trait.osstrext#tymethod.as_bytes) [source](https://doc.rust-lang.org/src/std/os/wasi/up/unix/ffi/os_str.rs.html#61-70)### impl OsStrExt for OsStr Available on **WASI** only. [source](https://doc.rust-lang.org/src/std/os/wasi/up/unix/ffi/os_str.rs.html#63-65)#### fn from\_bytes(slice: &[u8]) -> &OsStr Creates an [`OsStr`](struct.osstr "OsStr") from a byte slice. [Read more](../os/wasi/ffi/trait.osstrext#tymethod.from_bytes) [source](https://doc.rust-lang.org/src/std/os/wasi/up/unix/ffi/os_str.rs.html#67-69)#### fn as\_bytes(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Gets the underlying byte view of the [`OsStr`](struct.osstr "OsStr") slice. [Read more](../os/wasi/ffi/trait.osstrext#tymethod.as_bytes) [source](https://doc.rust-lang.org/src/std/os/windows/ffi.rs.html#131-136)### impl OsStrExt for OsStr Available on **Windows** only. [source](https://doc.rust-lang.org/src/std/os/windows/ffi.rs.html#133-135)#### fn encode\_wide(&self) -> EncodeWide<'\_> Notable traits for [EncodeWide](../os/windows/ffi/struct.encodewide "struct std::os::windows::ffi::EncodeWide")<'a> ``` impl<'a> Iterator for EncodeWide<'a> type Item = u16; ``` Re-encodes an `OsStr` as a wide character sequence, i.e., potentially ill-formed UTF-16. [Read more](../os/windows/ffi/trait.osstrext#tymethod.encode_wide) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialEq<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn eq(&self, other: &&'a OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)1.8.0 · ### impl<'a, 'b> PartialEq<&'a OsStr> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)#### fn eq(&self, other: &&'a OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)1.8.0 · ### impl<'a, 'b> PartialEq<&'a OsStr> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)#### fn eq(&self, other: &&'a OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)1.8.0 · ### impl<'a, 'b> PartialEq<&'a Path> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)#### fn eq(&self, other: &&'a Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn eq(&self, other: &&'b OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn eq(&self, other: &&'b OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for &'a Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1132-1137)### impl PartialEq<OsStr> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1134-1136)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1148-1153)### impl PartialEq<OsStr> for str [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1150-1152)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for &'a OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)1.8.0 · ### impl<'a, 'b> PartialEq<Path> for &'a OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)#### fn eq(&self, other: &Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)1.8.0 · ### impl<'a, 'b> PartialEq<Path> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)#### fn eq(&self, other: &Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)1.8.0 · ### impl<'a, 'b> PartialEq<PathBuf> for &'a OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)#### fn eq(&self, other: &PathBuf) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)1.8.0 · ### impl<'a, 'b> PartialEq<PathBuf> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)#### fn eq(&self, other: &PathBuf) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1140-1145)### impl PartialEq<str> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1142-1144)#### fn eq(&self, other: &str) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn partial\_cmp(&self, other: &&'a OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a OsStr> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)#### fn partial\_cmp(&self, other: &&'a OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a OsStr> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)#### fn partial\_cmp(&self, other: &&'a OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a Path> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)#### fn partial\_cmp(&self, other: &&'a Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn partial\_cmp(&self, other: &&'b OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn partial\_cmp(&self, other: &&'b OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for &'a Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3162)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1159-1180)### impl PartialOrd<OsStr> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1161-1163)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1165-1167)#### fn lt(&self, other: &OsStr) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1169-1171)#### fn le(&self, other: &OsStr) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1173-1175)#### fn gt(&self, other: &OsStr) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1177-1179)#### fn ge(&self, other: &OsStr) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for &'a OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for &'a OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3159)#### fn partial\_cmp(&self, other: &Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3158)#### fn partial\_cmp(&self, other: &Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for &'a OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3155)#### fn partial\_cmp(&self, other: &PathBuf) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3154)#### fn partial\_cmp(&self, other: &PathBuf) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1183-1188)### impl PartialOrd<str> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1185-1187)#### fn partial\_cmp(&self, other: &str) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1290-1300)### impl ToOwned for OsStr #### type Owned = OsString The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1293-1295)#### fn to\_owned(&self) -> OsString Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1297-1299)#### fn clone\_into(&self, target: &mut OsString) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1156)### impl Eq for OsStr Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for OsStr ### impl Send for OsStr ### impl !Sized for OsStr ### impl Sync for OsStr ### impl Unpin for OsStr ### impl UnwindSafe for OsStr Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut)
programming_docs
rust Type Definition std::ffi::c_uint Type Definition std::ffi::c\_uint ================================= ``` pub type c_uint = u32; ``` Equivalent to C’s `unsigned int` type. This type will almost always be [`u32`](../primitive.u32 "u32"), but may differ on some esoteric systems. The C standard technically only requires that this type be an unsigned integer with the same size as an [`int`](type.c_int); some systems define it as a [`u16`](../primitive.u16 "u16"), for example. rust Type Definition std::ffi::c_schar Type Definition std::ffi::c\_schar ================================== ``` pub type c_schar = i8; ``` Equivalent to C’s `signed char` type. This type will always be [`i8`](../primitive.i8 "i8"), but is included for completeness. It is defined as being a signed integer the same size as a C [`char`](type.c_char). rust Type Definition std::ffi::c_float Type Definition std::ffi::c\_float ================================== ``` pub type c_float = f32; ``` Equivalent to C’s `float` type. This type will almost always be [`f32`](../primitive.f32 "f32"), which is guaranteed to be an [IEEE 754 single-precision float](https://en.wikipedia.org/wiki/IEEE_754) in Rust. That said, the standard technically only guarantees that it be a floating-point number, and it may have less precision than `f32` or not follow the IEEE-754 standard at all. rust Type Definition std::ffi::c_uchar Type Definition std::ffi::c\_uchar ================================== ``` pub type c_uchar = u8; ``` Equivalent to C’s `unsigned char` type. This type will always be [`u8`](../primitive.u8 "u8"), but is included for completeness. It is defined as being an unsigned integer the same size as a C [`char`](type.c_char). rust Struct std::ffi::IntoStringError Struct std::ffi::IntoStringError ================================ ``` pub struct IntoStringError { /* private fields */ } ``` An error indicating invalid UTF-8 when converting a [`CString`](struct.cstring "CString") into a [`String`](../string/struct.string "String"). `CString` is just a wrapper over a buffer of bytes with a nul terminator; [`CString::into_string`](struct.cstring#method.into_string "CString::into_string") performs UTF-8 validation on those bytes and may return this error. This `struct` is created by [`CString::into_string()`](struct.cstring#method.into_string "CString::into_string()"). See its documentation for more. Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#979)### impl IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#984)1.7.0 · #### pub fn into\_cstring(self) -> CString Consumes this error, returning original [`CString`](struct.cstring "CString") which generated the error. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#991)1.7.0 · #### pub fn utf8\_error(&self) -> Utf8Error Access the underlying UTF-8 error that was the cause of this error. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)### impl Clone for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)#### fn clone(&self) -> IntoStringError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)### impl Debug for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1009)1.7.0 · ### impl Display for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1011)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1140)1.7.0 · ### impl Error for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1142)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1146)#### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)### impl PartialEq<IntoStringError> for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)#### fn eq(&self, other: &IntoStringError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)### impl Eq for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)### impl StructuralEq for IntoStringError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)### impl StructuralPartialEq for IntoStringError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for IntoStringError ### impl Send for IntoStringError ### impl Sync for IntoStringError ### impl Unpin for IntoStringError ### impl UnwindSafe for IntoStringError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Type Definition std::ffi::c_longlong Type Definition std::ffi::c\_longlong ===================================== ``` pub type c_longlong = i64; ``` Equivalent to C’s `signed long long` (`long long`) type. This type will almost always be [`i64`](../primitive.i64 "i64"), but may differ on some systems. The C standard technically only requires that this type be a signed integer that is at least 64 bits and at least the size of a [`long`](type.c_int), although in practice, no system would have a `long long` that is not an `i64`, as most systems do not have a standardised [`i128`](../primitive.i128 "i128") type. rust Type Definition std::ffi::c_ushort Type Definition std::ffi::c\_ushort =================================== ``` pub type c_ushort = u16; ``` Equivalent to C’s `unsigned short` type. This type will almost always be [`u16`](../primitive.u16 "u16"), but may differ on some esoteric systems. The C standard technically only requires that this type be an unsigned integer with the same size as a [`short`](type.c_short). rust Struct std::ffi::VaListImpl Struct std::ffi::VaListImpl =========================== ``` #[repr(C)]pub struct VaListImpl<'f> { /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) x86\_64 ABI implementation of a `va_list`. Implementations --------------- [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#414)### impl<'f> VaListImpl<'f> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#417)#### pub fn as\_va\_list(&'a mut self) -> VaList<'a, 'f> 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) Convert a `VaListImpl` into a `VaList` that is binary-compatible with C’s `va_list`. [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#507)### impl<'f> VaListImpl<'f> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#510)#### pub unsafe fn arg<T>(&mut self) -> Twhere T: VaArgSafe, 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) Advance to the next arg. [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#516-518)#### pub unsafe fn with\_copy<F, R>(&self, f: F) -> Rwhere F: for<'copy> [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([VaList](struct.valist "struct std::ffi::VaList")<'copy, 'f>) -> R, 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) Copies the `va_list` at the current location. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#536)### impl<'f> Clone for VaListImpl<'f> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#538)#### fn clone(&self) -> VaListImpl<'f> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#325)### impl<'f> Debug for VaListImpl<'f> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#325)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#554)### impl<'f> Drop for VaListImpl<'f> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#555)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) Auto Trait Implementations -------------------------- ### impl<'f> RefUnwindSafe for VaListImpl<'f> ### impl<'f> !Send for VaListImpl<'f> ### impl<'f> !Sync for VaListImpl<'f> ### impl<'f> Unpin for VaListImpl<'f> ### impl<'f> !UnwindSafe for VaListImpl<'f> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::ffi::FromBytesWithNulError Struct std::ffi::FromBytesWithNulError ====================================== ``` pub struct FromBytesWithNulError { /* private fields */ } ``` An error indicating that a nul byte was not in the expected position. The slice used to create a [`CStr`](struct.cstr "CStr") must have one and only one nul byte, positioned at the end. This error is created by the [`CStr::from_bytes_with_nul`](struct.cstr#method.from_bytes_with_nul "CStr::from_bytes_with_nul") method. See its documentation for more. Examples -------- ``` use std::ffi::{CStr, FromBytesWithNulError}; let _: FromBytesWithNulError = CStr::from_bytes_with_nul(b"f\0oo").unwrap_err(); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)### impl Clone for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)#### fn clone(&self) -> FromBytesWithNulError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)### impl Debug for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#177)1.17.0 · ### impl Display for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/error.rs.html#500)1.17.0 · ### impl Error for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/error.rs.html#502)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)### impl PartialEq<FromBytesWithNulError> for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)#### fn eq(&self, other: &FromBytesWithNulError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)### impl Eq for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)### impl StructuralEq for FromBytesWithNulError [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)### impl StructuralPartialEq for FromBytesWithNulError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for FromBytesWithNulError ### impl Send for FromBytesWithNulError ### impl Sync for FromBytesWithNulError ### impl Unpin for FromBytesWithNulError ### impl UnwindSafe for FromBytesWithNulError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Type Definition std::ffi::c_ulong Type Definition std::ffi::c\_ulong ================================== ``` pub type c_ulong = u64; ``` Equivalent to C’s `unsigned long` type. This type will always be [`u32`](../primitive.u32 "u32") or [`u64`](../primitive.u64 "u64"). Most notably, many Linux-based systems assume an `u64`, but Windows assumes `u32`. The C standard technically only requires that this type be an unsigned integer with the size of a [`long`](type.c_long), although in practice, no system would have a `ulong` that is neither a `u32` nor `u64`. rust Struct std::ffi::OsString Struct std::ffi::OsString ========================= ``` pub struct OsString { /* private fields */ } ``` A type that can represent owned, mutable platform-native strings, but is cheaply inter-convertible with Rust strings. The need for this type arises from the fact that: * On Unix systems, strings are often arbitrary sequences of non-zero bytes, in many cases interpreted as UTF-8. * On Windows, strings are often arbitrary sequences of non-zero 16-bit values, interpreted as UTF-16 when it is valid to do so. * In Rust, strings are always valid UTF-8, which may contain zeros. `OsString` and [`OsStr`](struct.osstr "OsStr") bridge this gap by simultaneously representing Rust and platform-native string values, and in particular allowing a Rust string to be converted into an “OS” string with no cost if possible. A consequence of this is that `OsString` instances are *not* `NUL` terminated; in order to pass to e.g., Unix system call, you should create a [`CStr`](struct.cstr). `OsString` is to `&[OsStr](struct.osstr "OsStr")` as [`String`](../string/struct.string "String") is to `&[str](../primitive.str "str")`: the former in each pair are owned strings; the latter are borrowed references. Note, `OsString` and [`OsStr`](struct.osstr "OsStr") internally do not necessarily hold strings in the form native to the platform; While on Unix, strings are stored as a sequence of 8-bit values, on Windows, where strings are 16-bit value based as just discussed, strings are also actually stored as a sequence of 8-bit values, encoded in a less-strict variant of UTF-8. This is useful to understand when handling capacity and length values. Capacity of `OsString` ---------------------- Capacity uses units of UTF-8 bytes for OS strings which were created from valid unicode, and uses units of bytes in an unspecified encoding for other contents. On a given target, all `OsString` and `OsStr` values use the same units for capacity, so the following will work: ``` use std::ffi::{OsStr, OsString}; fn concat_os_strings(a: &OsStr, b: &OsStr) -> OsString { let mut ret = OsString::with_capacity(a.len() + b.len()); // This will allocate ret.push(a); // This will not allocate further ret.push(b); // This will not allocate further ret } ``` Creating an `OsString` ---------------------- **From a Rust string**: `OsString` implements `[From](../convert/trait.from "From")<[String](../string/struct.string "String")>`, so you can use `my_string.[into](../convert/trait.into#tymethod.into)()` to create an `OsString` from a normal Rust string. **From slices:** Just like you can start with an empty Rust [`String`](../string/struct.string "String") and then [`String::push_str`](../string/struct.string#method.push_str "String::push_str") some `&[str](../primitive.str "str")` sub-string slices into it, you can create an empty `OsString` with the [`OsString::new`](struct.osstring#method.new "OsString::new") method and then push string slices into it with the [`OsString::push`](struct.osstring#method.push "OsString::push") method. Extracting a borrowed reference to the whole OS string ------------------------------------------------------ You can use the [`OsString::as_os_str`](struct.osstring#method.as_os_str "OsString::as_os_str") method to get an `&[OsStr](struct.osstr "OsStr")` from an `OsString`; this is effectively a borrowed reference to the whole string. Conversions ----------- See the [module’s toplevel documentation about conversions](index#conversions) for a discussion on the traits which `OsString` implements for [conversions](index#conversions) from/to native representations. Implementations --------------- [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#128-469)### impl OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#141-143)#### pub fn new() -> OsString Constructs a new empty `OsString`. ##### Examples ``` use std::ffi::OsString; let os_string = OsString::new(); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#159-161)#### pub fn as\_os\_str(&self) -> &OsStr Converts to an [`OsStr`](struct.osstr "OsStr") slice. ##### Examples ``` use std::ffi::{OsString, OsStr}; let os_string = OsString::from("foo"); let os_str = OsStr::new("foo"); assert_eq!(os_string.as_os_str(), os_str); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#178-180)#### pub fn into\_string(self) -> Result<String, OsString> Converts the `OsString` into a [`String`](../string/struct.string "String") if it contains valid Unicode data. On failure, ownership of the original `OsString` is returned. ##### Examples ``` use std::ffi::OsString; let os_string = OsString::from("foo"); let string = os_string.into_string(); assert_eq!(string, Ok(String::from("foo"))); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#195-197)#### pub fn push<T: AsRef<OsStr>>(&mut self, s: T) Extends the string with the given `&[OsStr](struct.osstr "OsStr")` slice. ##### Examples ``` use std::ffi::OsString; let mut os_string = OsString::from("foo"); os_string.push("bar"); assert_eq!(&os_string, "foobar"); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#224-226)1.9.0 · #### pub fn with\_capacity(capacity: usize) -> OsString Creates a new `OsString` with at least the given capacity. The string will be able to hold at least `capacity` length units of other OS strings without reallocating. This method is allowed to allocate for more units than `capacity`. If `capacity` is 0, the string will not allocate. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsString; let mut os_string = OsString::with_capacity(10); let capacity = os_string.capacity(); // This push is done without reallocating os_string.push("foo"); assert_eq!(capacity, os_string.capacity()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#243-245)1.9.0 · #### pub fn clear(&mut self) Truncates the `OsString` to zero length. ##### Examples ``` use std::ffi::OsString; let mut os_string = OsString::from("foo"); assert_eq!(&os_string, "foo"); os_string.clear(); assert_eq!(&os_string, ""); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#262-264)1.9.0 · #### pub fn capacity(&self) -> usize Returns the capacity this `OsString` can hold without reallocating. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsString; let os_string = OsString::with_capacity(10); assert!(os_string.capacity() >= 10); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#285-287)1.9.0 · #### pub fn reserve(&mut self, additional: usize) Reserves capacity for at least `additional` more capacity to be inserted in the given `OsString`. Does nothing if the capacity is already sufficient. The collection may reserve more space to speculatively avoid frequent reallocations. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsString; let mut s = OsString::new(); s.reserve(10); assert!(s.capacity() >= 10); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#324-326)1.63.0 · #### pub fn try\_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> Tries to reserve capacity for at least `additional` more length units in the given `OsString`. The string may reserve more space to speculatively avoid frequent reallocations. After calling `try_reserve`, capacity will be greater than or equal to `self.len() + additional` if it returns `Ok(())`. Does nothing if capacity is already sufficient. This method preserves the contents even if an error occurs. See the main `OsString` documentation information about encoding and capacity units. ##### Errors If the capacity overflows, or the allocator reports a failure, then an error is returned. ##### Examples ``` use std::ffi::{OsStr, OsString}; use std::collections::TryReserveError; fn process_data(data: &str) -> Result<OsString, TryReserveError> { let mut s = OsString::new(); // Pre-reserve the memory, exiting if we can't s.try_reserve(OsStr::new(data).len())?; // Now we know this can't OOM in the middle of our complex work s.push(data); Ok(s) } ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#351-353)1.9.0 · #### pub fn reserve\_exact(&mut self, additional: usize) Reserves the minimum capacity for at least `additional` more capacity to be inserted in the given `OsString`. Does nothing if the capacity is already sufficient. Note that the allocator may give the collection more space than it requests. Therefore, capacity can not be relied upon to be precisely minimal. Prefer [`reserve`](struct.osstring#method.reserve) if future insertions are expected. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsString; let mut s = OsString::new(); s.reserve_exact(10); assert!(s.capacity() >= 10); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#395-397)1.63.0 · #### pub fn try\_reserve\_exact( &mut self, additional: usize) -> Result<(), TryReserveError> Tries to reserve the minimum capacity for at least `additional` more length units in the given `OsString`. After calling `try_reserve_exact`, capacity will be greater than or equal to `self.len() + additional` if it returns `Ok(())`. Does nothing if the capacity is already sufficient. Note that the allocator may give the `OsString` more space than it requests. Therefore, capacity can not be relied upon to be precisely minimal. Prefer [`try_reserve`](struct.osstring#method.try_reserve) if future insertions are expected. See the main `OsString` documentation information about encoding and capacity units. ##### Errors If the capacity overflows, or the allocator reports a failure, then an error is returned. ##### Examples ``` use std::ffi::{OsStr, OsString}; use std::collections::TryReserveError; fn process_data(data: &str) -> Result<OsString, TryReserveError> { let mut s = OsString::new(); // Pre-reserve the memory, exiting if we can't s.try_reserve_exact(OsStr::new(data).len())?; // Now we know this can't OOM in the middle of our complex work s.push(data); Ok(s) } ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#418-420)1.19.0 · #### pub fn shrink\_to\_fit(&mut self) Shrinks the capacity of the `OsString` to match its length. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsString; let mut s = OsString::from("foo"); s.reserve(100); assert!(s.capacity() >= 100); s.shrink_to_fit(); assert_eq!(3, s.capacity()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#448-450)1.56.0 · #### pub fn shrink\_to(&mut self, min\_capacity: usize) Shrinks the capacity of the `OsString` with a lower bound. The capacity will remain at least as large as both the length and the supplied value. If the current capacity is less than the lower limit, this is a no-op. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsString; let mut s = OsString::from("foo"); s.reserve(100); assert!(s.capacity() >= 100); s.shrink_to(10); assert!(s.capacity() >= 10); s.shrink_to(0); assert!(s.capacity() >= 3); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#465-468)1.20.0 · #### pub fn into\_boxed\_os\_str(self) -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts this `OsString` into a boxed [`OsStr`](struct.osstr "OsStr"). ##### Examples ``` use std::ffi::{OsString, OsStr}; let s = OsString::from("hello"); let b: Box<OsStr> = s.into_boxed_os_str(); ``` Methods from [Deref](../ops/trait.deref "trait std::ops::Deref")<Target = [OsStr](struct.osstr "struct std::ffi::OsStr")> ------------------------------------------------------------------------------------------------------------------------- [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#703-705)#### pub fn to\_str(&self) -> Option<&str> Yields a `&[str](../primitive.str "str")` slice if the `OsStr` is valid Unicode. This conversion may entail doing a check for UTF-8 validity. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new("foo"); assert_eq!(os_str.to_str(), Some("foo")); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#756-758)#### pub fn to\_string\_lossy(&self) -> Cow<'\_, str> Converts an `OsStr` to a `[Cow](../borrow/enum.cow "Cow")<[str](../primitive.str "str")>`. Any non-Unicode sequences are replaced with [`U+FFFD REPLACEMENT CHARACTER`](../char/constant.replacement_character). ##### Examples Calling `to_string_lossy` on an `OsStr` with invalid unicode: ``` // Note, due to differences in how Unix and Windows represent strings, // we are forced to complicate this example, setting up example `OsStr`s // with different source data and via different platform extensions. // Understand that in reality you could end up with such example invalid // sequences simply through collecting user command line arguments, for // example. #[cfg(unix)] { use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; // Here, the values 0x66 and 0x6f correspond to 'f' and 'o' // respectively. The value 0x80 is a lone continuation byte, invalid // in a UTF-8 sequence. let source = [0x66, 0x6f, 0x80, 0x6f]; let os_str = OsStr::from_bytes(&source[..]); assert_eq!(os_str.to_string_lossy(), "fo�o"); } #[cfg(windows)] { use std::ffi::OsString; use std::os::windows::prelude::*; // Here the values 0x0066 and 0x006f correspond to 'f' and 'o' // respectively. The value 0xD800 is a lone surrogate half, invalid // in a UTF-16 sequence. let source = [0x0066, 0x006f, 0xD800, 0x006f]; let os_string = OsString::from_wide(&source[..]); let os_str = os_string.as_os_str(); assert_eq!(os_str.to_string_lossy(), "fo�o"); } ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#775-777)#### pub fn to\_os\_string(&self) -> OsString Copies the slice into an owned [`OsString`](struct.osstring "OsString"). ##### Examples ``` use std::ffi::{OsStr, OsString}; let os_str = OsStr::new("foo"); let os_string = os_str.to_os_string(); assert_eq!(os_string, OsString::from("foo")); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#795-797)1.9.0 · #### pub fn is\_empty(&self) -> bool Checks whether the `OsStr` is empty. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new(""); assert!(os_str.is_empty()); let os_str = OsStr::new("foo"); assert!(!os_str.is_empty()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#829-831)1.9.0 · #### pub fn len(&self) -> usize Returns the length of this `OsStr`. Note that this does **not** return the number of bytes in the string in OS string form. The length returned is that of the underlying storage used by `OsStr`. As discussed in the [`OsString`](struct.osstring "OsString") introduction, [`OsString`](struct.osstring "OsString") and `OsStr` store strings in a form best suited for cheap inter-conversion between native-platform and Rust string forms, which may differ significantly from both of them, including in storage size and encoding. This number is simply useful for passing to other methods, like [`OsString::with_capacity`](struct.osstring#method.with_capacity "OsString::with_capacity") to avoid reallocations. See the main `OsString` documentation information about encoding and capacity units. ##### Examples ``` use std::ffi::OsStr; let os_str = OsStr::new(""); assert_eq!(os_str.len(), 0); let os_str = OsStr::new("foo"); assert_eq!(os_str.len(), 3); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#871-873)1.53.0 · #### pub fn make\_ascii\_lowercase(&mut self) Converts this string to its ASCII lower case equivalent in-place. ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged. To return a new lowercased value without modifying the existing one, use [`OsStr::to_ascii_lowercase`](struct.osstr#method.to_ascii_lowercase "OsStr::to_ascii_lowercase"). ##### Examples ``` use std::ffi::OsString; let mut s = OsString::from("GRÜßE, JÜRGEN ❤"); s.make_ascii_lowercase(); assert_eq!("grÜße, jÜrgen ❤", s); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#896-898)1.53.0 · #### pub fn make\_ascii\_uppercase(&mut self) Converts this string to its ASCII upper case equivalent in-place. ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged. To return a new uppercased value without modifying the existing one, use [`OsStr::to_ascii_uppercase`](struct.osstr#method.to_ascii_uppercase "OsStr::to_ascii_uppercase"). ##### Examples ``` use std::ffi::OsString; let mut s = OsString::from("Grüße, Jürgen ❤"); s.make_ascii_uppercase(); assert_eq!("GRüßE, JüRGEN ❤", s); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#918-920)1.53.0 · #### pub fn to\_ascii\_lowercase(&self) -> OsString Returns a copy of this string where each character is mapped to its ASCII lower case equivalent. ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged. To lowercase the value in-place, use [`OsStr::make_ascii_lowercase`](struct.osstr#method.make_ascii_lowercase "OsStr::make_ascii_lowercase"). ##### Examples ``` use std::ffi::OsString; let s = OsString::from("Grüße, Jürgen ❤"); assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#940-942)1.53.0 · #### pub fn to\_ascii\_uppercase(&self) -> OsString Returns a copy of this string where each character is mapped to its ASCII upper case equivalent. ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged. To uppercase the value in-place, use [`OsStr::make_ascii_uppercase`](struct.osstr#method.make_ascii_uppercase "OsStr::make_ascii_uppercase"). ##### Examples ``` use std::ffi::OsString; let s = OsString::from("Grüße, Jürgen ❤"); assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#960-962)1.53.0 · #### pub fn is\_ascii(&self) -> bool Checks if all characters in this string are within the ASCII range. ##### Examples ``` use std::ffi::OsString; let ascii = OsString::from("hello!\n"); let non_ascii = OsString::from("Grüße, Jürgen ❤"); assert!(ascii.is_ascii()); assert!(!non_ascii.is_ascii()); ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#979-981)1.53.0 · #### pub fn eq\_ignore\_ascii\_case<S: AsRef<OsStr>>(&self, other: S) -> bool Checks that two strings are an ASCII case-insensitive match. Same as `to_ascii_lowercase(a) == to_ascii_lowercase(b)`, but without allocating and copying temporaries. ##### Examples ``` use std::ffi::OsString; assert!(OsString::from("Ferris").eq_ignore_ascii_case("FERRIS")); assert!(OsString::from("Ferrös").eq_ignore_ascii_case("FERRöS")); assert!(!OsString::from("Ferrös").eq_ignore_ascii_case("FERRÖS")); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1311-1316)### impl AsRef<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1313-1315)#### fn as\_ref(&self) -> &OsStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/path.rs.html#3025-3030)### impl AsRef<Path> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3027-3029)#### fn as\_ref(&self) -> &Path Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1282-1287)### impl Borrow<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1284-1286)#### fn borrow(&self) -> &OsStr Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#537-547)### impl Clone for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#539-541)#### fn clone(&self) -> Self Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#544-546)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#550-554)### impl Debug for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#551-553)#### fn fmt(&self, formatter: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#528-534)1.9.0 · ### impl Default for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#531-533)#### fn default() -> OsString Constructs an empty `OsString`. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#510-517)### impl Deref for OsString #### type Target = OsStr The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#514-516)#### fn deref(&self) -> &OsStr Dereferences the value. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#520-525)1.44.0 · ### impl DerefMut for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#522-524)#### fn deref\_mut(&mut self) -> &mut OsStr Mutably dereferences the value. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1376-1383)1.52.0 · ### impl<'a> Extend<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1378-1382)#### fn extend<T: IntoIterator<Item = &'a OsStr>>(&mut self, iter: T) Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#371)#### fn extend\_one(&mut self, item: A) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1386-1393)1.52.0 · ### impl<'a> Extend<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1388-1392)#### fn extend<T: IntoIterator<Item = Cow<'a, OsStr>>>(&mut self, iter: T) Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#371)#### fn extend\_one(&mut self, item: A) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1366-1373)1.52.0 · ### impl Extend<OsString> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1368-1372)#### fn extend<T: IntoIterator<Item = OsString>>(&mut self, iter: T) Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#371)#### fn extend\_one(&mut self, item: A) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1095-1101)1.28.0 · ### impl<'a> From<&'a OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1098-1100)#### fn from(s: &'a OsString) -> Cow<'a, OsStr> Converts the string reference into a [`Cow::Borrowed`](../borrow/enum.cow#variant.Borrowed "Cow::Borrowed"). [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#483-489)### impl<T: ?Sized + AsRef<OsStr>> From<&T> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#486-488)#### fn from(s: &T) -> OsString Copies any value implementing `[AsRef](../convert/trait.asref "AsRef")<[OsStr](struct.osstr "OsStr")>` into a newly allocated [`OsString`](struct.osstring "OsString"). [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1008-1015)1.18.0 · ### impl From<Box<OsStr, Global>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1012-1014)#### fn from(boxed: Box<OsStr>) -> OsString Converts a `[Box](../boxed/struct.box "Box")<[OsStr](struct.osstr "OsStr")>` into an [`OsString`](struct.osstring "OsString") without copying or allocating. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1104-1111)1.28.0 · ### impl<'a> From<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1108-1110)#### fn from(s: Cow<'a, OsStr>) -> Self Converts a `Cow<'a, OsStr>` into an [`OsString`](struct.osstring "OsString"), by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1035-1043)1.24.0 · ### impl From<OsString> for Arc<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1039-1042)#### fn from(s: OsString) -> Arc<OsStr> Converts an [`OsString`](struct.osstring "OsString") into an `[Arc](../sync/struct.arc "Arc")<[OsStr](struct.osstr "OsStr")>` by moving the [`OsString`](struct.osstring "OsString") data into a new [`Arc`](../sync/struct.arc "Arc") buffer. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1018-1024)1.20.0 · ### impl From<OsString> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1021-1023)#### fn from(s: OsString) -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts an [`OsString`](struct.osstring "OsString") into a `[Box](../boxed/struct.box "Box")<[OsStr](struct.osstr "OsStr")>` without copying or allocating. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1077-1083)1.28.0 · ### impl<'a> From<OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1080-1082)#### fn from(s: OsString) -> Cow<'a, OsStr> Moves the string into a [`Cow::Owned`](../borrow/enum.cow#variant.Owned "Cow::Owned"). [source](https://doc.rust-lang.org/src/std/path.rs.html#1648-1656)### impl From<OsString> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#1653-1655)#### fn from(s: OsString) -> PathBuf Converts an [`OsString`](struct.osstring "OsString") into a [`PathBuf`](../path/struct.pathbuf "PathBuf") This conversion does not allocate or copy memory. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1056-1064)1.24.0 · ### impl From<OsString> for Rc<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1060-1063)#### fn from(s: OsString) -> Rc<OsStr> Converts an [`OsString`](struct.osstring "OsString") into an `[Rc](../rc/struct.rc "Rc")<[OsStr](struct.osstr "OsStr")>` by moving the [`OsString`](struct.osstring "OsString") data into a new [`Rc`](../rc/struct.rc "Rc") buffer. [source](https://doc.rust-lang.org/src/std/path.rs.html#1659-1667)1.14.0 · ### impl From<PathBuf> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#1664-1666)#### fn from(path\_buf: PathBuf) -> OsString Converts a [`PathBuf`](../path/struct.pathbuf "PathBuf") into an [`OsString`](struct.osstring "OsString") This conversion does not allocate or copy memory. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#472-480)### impl From<String> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#477-479)#### fn from(s: String) -> OsString Converts a [`String`](../string/struct.string "String") into an [`OsString`](struct.osstring "OsString"). This conversion does not allocate or copy memory. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1415-1424)1.52.0 · ### impl<'a> FromIterator<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1417-1423)#### fn from\_iter<I: IntoIterator<Item = &'a OsStr>>(iter: I) -> Self Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1427-1448)1.52.0 · ### impl<'a> FromIterator<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1429-1447)#### fn from\_iter<I: IntoIterator<Item = Cow<'a, OsStr>>>(iter: I) -> Self Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1396-1412)1.52.0 · ### impl FromIterator<OsString> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1398-1411)#### fn from\_iter<I: IntoIterator<Item = OsString>>(iter: I) -> Self Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1356-1363)1.45.0 · ### impl FromStr for OsString #### type Err = Infallible The associated error which can be returned from parsing. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1360-1362)#### fn from\_str(s: &str) -> Result<Self, Self::Err> Parses a string `s` to return a value of this type. [Read more](../str/trait.fromstr#tymethod.from_str) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#640-645)### impl Hash for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#642-644)#### fn hash<H: Hasher>(&self, state: &mut H) Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#492-499)### impl Index<RangeFull> for OsString #### type Output = OsStr The returned type after indexing. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#496-498)#### fn index(&self, \_index: RangeFull) -> &OsStr Performs the indexing (`container[index]`) operation. [Read more](../ops/trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#502-507)1.44.0 · ### impl IndexMut<RangeFull> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#504-506)#### fn index\_mut(&mut self, \_index: RangeFull) -> &mut OsStr Performs the mutable indexing (`container[index]`) operation. [Read more](../ops/trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#632-637)### impl Ord for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#634-636)#### fn cmp(&self, other: &OsString) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/std/os/unix/ffi/os_str.rs.html#30-39)### impl OsStringExt for OsString Available on **Unix** only. [source](https://doc.rust-lang.org/src/std/os/unix/ffi/os_str.rs.html#32-34)#### fn from\_vec(vec: Vec<u8>) -> OsString Creates an [`OsString`](struct.osstring "OsString") from a byte vector. [Read more](../os/unix/ffi/trait.osstringext#tymethod.from_vec) [source](https://doc.rust-lang.org/src/std/os/unix/ffi/os_str.rs.html#36-38)#### fn into\_vec(self) -> Vec<u8> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Yields the underlying byte vector of this [`OsString`](struct.osstring "OsString"). [Read more](../os/unix/ffi/trait.osstringext#tymethod.into_vec) [source](https://doc.rust-lang.org/src/std/os/wasi/up/unix/ffi/os_str.rs.html#30-39)### impl OsStringExt for OsString Available on **WASI** only. [source](https://doc.rust-lang.org/src/std/os/wasi/up/unix/ffi/os_str.rs.html#32-34)#### fn from\_vec(vec: Vec<u8>) -> OsString Creates an [`OsString`](struct.osstring "OsString") from a byte vector. [Read more](../os/wasi/ffi/trait.osstringext#tymethod.from_vec) [source](https://doc.rust-lang.org/src/std/os/wasi/up/unix/ffi/os_str.rs.html#36-38)#### fn into\_vec(self) -> Vec<u8> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Yields the underlying byte vector of this [`OsString`](struct.osstring "OsString"). [Read more](../os/wasi/ffi/trait.osstringext#tymethod.into_vec) [source](https://doc.rust-lang.org/src/std/os/windows/ffi.rs.html#93-97)### impl OsStringExt for OsString Available on **Windows** only. [source](https://doc.rust-lang.org/src/std/os/windows/ffi.rs.html#94-96)#### fn from\_wide(wide: &[u16]) -> OsString Creates an `OsString` from a potentially ill-formed UTF-16 slice of 16-bit code units. [Read more](../os/windows/ffi/trait.osstringext#tymethod.from_wide) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialEq<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn eq(&self, other: &&'a OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)1.8.0 · ### impl<'a, 'b> PartialEq<&'a Path> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)#### fn eq(&self, other: &&'a Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#581-586)1.29.0 · ### impl PartialEq<&str> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#583-585)#### fn eq(&self, other: &&str) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for &'a OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for &'a Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#589-594)1.29.0 · ### impl<'a> PartialEq<OsString> for &'a str [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#591-593)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#557-562)### impl PartialEq<OsString> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#559-561)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#573-578)### impl PartialEq<OsString> for str [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#575-577)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)1.8.0 · ### impl<'a, 'b> PartialEq<Path> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)#### fn eq(&self, other: &Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)1.8.0 · ### impl<'a, 'b> PartialEq<PathBuf> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)#### fn eq(&self, other: &PathBuf) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#565-570)### impl PartialEq<str> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#567-569)#### fn eq(&self, other: &str) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn partial\_cmp(&self, other: &&'a OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a Path> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)#### fn partial\_cmp(&self, other: &&'a Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for &'a OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1238)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for &'a Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3164)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1237)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#600-621)### impl PartialOrd<OsString> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#602-604)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#606-608)#### fn lt(&self, other: &OsString) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#610-612)#### fn le(&self, other: &OsString) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#614-616)#### fn gt(&self, other: &OsString) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#618-620)#### fn ge(&self, other: &OsString) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3161)#### fn partial\_cmp(&self, other: &Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3157)#### fn partial\_cmp(&self, other: &PathBuf) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#624-629)### impl PartialOrd<str> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#626-628)#### fn partial\_cmp(&self, other: &str) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#648-653)1.64.0 · ### impl Write for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#649-652)#### fn write\_str(&mut self, s: &str) -> Result Writes a string slice into this writer, returning whether the write succeeded. [Read more](../fmt/trait.write#tymethod.write_str) [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#168)1.1.0 · #### fn write\_char(&mut self, c: char) -> Result<(), Error> Writes a [`char`](../primitive.char "char") into this writer, returning whether the write succeeded. [Read more](../fmt/trait.write#method.write_char) [source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#191)#### fn write\_fmt(&mut self, args: Arguments<'\_>) -> Result<(), Error> Glue for usage of the [`write!`](../macro.write "write!") macro with implementors of this trait. [Read more](../fmt/trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#597)### impl Eq for OsString Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for OsString ### impl Send for OsString ### impl Sync for OsString ### impl Unpin for OsString ### impl UnwindSafe for OsString Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::ffi::VaList Struct std::ffi::VaList ======================= ``` #[repr(transparent)]pub struct VaList<'a, 'f>where    'f: 'a,{ /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) A wrapper for a `va_list` Methods from [Deref](../ops/trait.deref "trait std::ops::Deref")<Target = [VaListImpl](struct.valistimpl "struct std::ffi::VaListImpl")<'f>> -------------------------------------------------------------------------------------------------------------------------------------------- [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#417)#### pub fn as\_va\_list(&'a mut self) -> VaList<'a, 'f> 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) Convert a `VaListImpl` into a `VaList` that is binary-compatible with C’s `va_list`. [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#510)#### pub unsafe fn arg<T>(&mut self) -> Twhere T: VaArgSafe, 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) Advance to the next arg. [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#516-518)#### pub unsafe fn with\_copy<F, R>(&self, f: F) -> Rwhere F: for<'copy> [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([VaList](struct.valist "struct std::ffi::VaList")<'copy, 'f>) -> R, 🔬This is a nightly-only experimental API. (`c_variadic` [#44930](https://github.com/rust-lang/rust/issues/44930)) Copies the `va_list` at the current location. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#343)### impl<'a, 'f> Debug for VaList<'a, 'f>where 'f: 'a, [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#343)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#428)### impl<'a, 'f> Deref for VaList<'a, 'f>where 'f: 'a, #### type Target = VaListImpl<'f> The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#432)#### fn deref(&self) -> &VaListImpl<'f> Dereferences the value. [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#443)### impl<'a, 'f> DerefMut for VaList<'a, 'f>where 'f: 'a, [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#445)#### fn deref\_mut(&mut self) -> &mut VaListImpl<'f> Mutably dereferences the value. Auto Trait Implementations -------------------------- ### impl<'a, 'f> RefUnwindSafe for VaList<'a, 'f> ### impl<'a, 'f> !Send for VaList<'a, 'f> ### impl<'a, 'f> !Sync for VaList<'a, 'f> ### impl<'a, 'f> Unpin for VaList<'a, 'f>where 'f: 'a, ### impl<'a, 'f> !UnwindSafe for VaList<'a, 'f> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Type Definition std::ffi::c_ulonglong Type Definition std::ffi::c\_ulonglong ====================================== ``` pub type c_ulonglong = u64; ``` Equivalent to C’s `unsigned long long` type. This type will almost always be [`u64`](../primitive.u64 "u64"), but may differ on some systems. The C standard technically only requires that this type be an unsigned integer with the size of a [`long long`](type.c_longlong), although in practice, no system would have a `long long` that is not a `u64`, as most systems do not have a standardised [`u128`](../primitive.u128 "u128") type. rust Struct std::ffi::NulError Struct std::ffi::NulError ========================= ``` pub struct NulError(_, _); ``` An error indicating that an interior nul byte was found. While Rust strings may contain nul bytes in the middle, C strings can’t, as that byte would effectively truncate the string. This error is created by the [`new`](struct.cstring#method.new "CString::new") method on [`CString`](struct.cstring "CString"). See its documentation for more. Examples -------- ``` use std::ffi::{CString, NulError}; let _: NulError = CString::new(b"f\0oo".to_vec()).unwrap_err(); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#919)### impl NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#936)1.0.0 · #### pub fn nul\_position(&self) -> usize Returns the position of the nul byte in the slice that caused [`CString::new`](struct.cstring#method.new "CString::new") to fail. ##### Examples ``` use std::ffi::CString; let nul_error = CString::new("foo\0bar").unwrap_err(); assert_eq!(nul_error.nul_position(), 3); let nul_error = CString::new("foo bar\0").unwrap_err(); assert_eq!(nul_error.nul_position(), 7); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#953)1.0.0 · #### pub fn into\_vec(self) -> Vec<u8, Global> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Consumes this error, returning the underlying vector of bytes which generated the error in the first place. ##### Examples ``` use std::ffi::CString; let nul_error = CString::new("foo\0bar").unwrap_err(); assert_eq!(nul_error.into_vec(), b"foo\0bar"); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)### impl Clone for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)#### fn clone(&self) -> NulError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)### impl Debug for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#959)1.0.0 · ### impl Display for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#960)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1127)1.0.0 · ### impl Error for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1129)#### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/std/io/error.rs.html#81-86)1.0.0 · ### impl From<NulError> for Error [source](https://doc.rust-lang.org/src/std/io/error.rs.html#83-85)#### fn from(\_: NulError) -> Error Converts a [`alloc::ffi::NulError`](struct.nulerror "alloc::ffi::NulError") into a [`Error`](../io/struct.error "Error"). [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)### impl PartialEq<NulError> for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)#### fn eq(&self, other: &NulError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)### impl Eq for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)### impl StructuralEq for NulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)### impl StructuralPartialEq for NulError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for NulError ### impl Send for NulError ### impl Sync for NulError ### impl Unpin for NulError ### impl UnwindSafe for NulError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::ffi::CString Struct std::ffi::CString ======================== ``` pub struct CString { /* private fields */ } ``` A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the middle. This type serves the purpose of being able to safely generate a C-compatible string from a Rust byte slice or vector. An instance of this type is a static guarantee that the underlying bytes contain no interior 0 bytes (“nul characters”) and that the final byte is 0 (“nul terminator”). `CString` is to `&[CStr](struct.cstr "CStr")` as [`String`](../string/struct.string "String") is to `&[str](../primitive.str "str")`: the former in each pair are owned strings; the latter are borrowed references. Creating a `CString` -------------------- A `CString` is created from either a byte slice or a byte vector, or anything that implements `[Into](../convert/trait.into "Into")<[Vec](../vec/struct.vec "Vec")<[u8](../primitive.u8 "u8")>>` (for example, you can build a `CString` straight out of a [`String`](../string/struct.string "String") or a `&[str](../primitive.str "str")`, since both implement that trait). The [`CString::new`](struct.cstring#method.new "CString::new") method will actually check that the provided `&[[u8](../primitive.u8 "u8")]` does not have 0 bytes in the middle, and return an error if it finds one. Extracting a raw pointer to the whole C string ---------------------------------------------- `CString` implements an [`as_ptr`](struct.cstr#method.as_ptr "CStr::as_ptr") method through the [`Deref`](../ops/trait.deref) trait. This method will give you a `*const c_char` which you can feed directly to extern functions that expect a nul-terminated string, like C’s `strdup()`. Notice that [`as_ptr`](struct.cstr#method.as_ptr "CStr::as_ptr") returns a read-only pointer; if the C code writes to it, that causes undefined behavior. Extracting a slice of the whole C string ---------------------------------------- Alternatively, you can obtain a `&[[u8](../primitive.u8 "u8")]` slice from a `CString` with the [`CString::as_bytes`](struct.cstring#method.as_bytes "CString::as_bytes") method. Slices produced in this way do *not* contain the trailing nul terminator. This is useful when you will be calling an extern function that takes a `*const u8` argument which is not necessarily nul-terminated, plus another argument with the length of the string — like C’s `strndup()`. You can of course get the slice’s length with its [`len`](../primitive.slice#method.len "slice::len") method. If you need a `&[[u8](../primitive.u8 "u8")]` slice *with* the nul terminator, you can use [`CString::as_bytes_with_nul`](struct.cstring#method.as_bytes_with_nul "CString::as_bytes_with_nul") instead. Once you have the kind of slice you need (with or without a nul terminator), you can call the slice’s own [`as_ptr`](../primitive.slice#method.as_ptr "slice::as_ptr") method to get a read-only raw pointer to pass to extern functions. See the documentation for that function for a discussion on ensuring the lifetime of the raw pointer. Examples -------- ⓘ ``` use std::ffi::CString; use std::os::raw::c_char; extern "C" { fn my_printer(s: *const c_char); } // We are certain that our string doesn't have 0 bytes in the middle, // so we can .expect() let c_to_print = CString::new("Hello, world!").expect("CString::new failed"); unsafe { my_printer(c_to_print.as_ptr()); } ``` Safety ------ `CString` is intended for working with traditional C-style strings (a sequence of non-nul bytes terminated by a single nul byte); the primary use case for these kinds of strings is interoperating with C-like code. Often you will need to transfer ownership to/from that external code. It is strongly recommended that you thoroughly read through the documentation of `CString` before use, as improper ownership management of `CString` instances can lead to invalid memory accesses, memory leaks, and other memory errors. Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#232)### impl CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#261)1.0.0 · #### pub fn new<T>(t: T) -> Result<CString, NulError>where T: [Into](../convert/trait.into "trait std::convert::Into")<[Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), [Global](../alloc/struct.global "struct std::alloc::Global")>>, Creates a new C-compatible string from a container of bytes. This function will consume the provided data and use the underlying bytes to construct a new string, ensuring that there is a trailing 0 byte. This trailing 0 byte will be appended by this function; the provided data should *not* contain any 0 bytes in it. ##### Examples ⓘ ``` use std::ffi::CString; use std::os::raw::c_char; extern "C" { fn puts(s: *const c_char); } let to_print = CString::new("Hello!").expect("CString::new failed"); unsafe { puts(to_print.as_ptr()); } ``` ##### Errors This function will return an error if the supplied bytes contain an internal 0 byte. The [`NulError`](struct.nulerror "NulError") returned will contain the bytes as well as the position of the nul byte. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#340)1.0.0 · #### pub unsafe fn from\_vec\_unchecked(v: Vec<u8, Global>) -> CString Creates a C-compatible string by consuming a byte vector, without checking for interior 0 bytes. Trailing 0 byte will be appended by this function. This method is equivalent to [`CString::new`](struct.cstring#method.new "CString::new") except that no runtime assertion is made that `v` contains no 0 bytes, and it requires an actual byte vector, not anything that can be converted to one with Into. ##### Examples ``` use std::ffi::CString; let raw = b"foo".to_vec(); unsafe { let c_string = CString::from_vec_unchecked(raw); } ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#397)1.4.0 · #### pub unsafe fn from\_raw(ptr: \*mut i8) -> CString Retakes ownership of a `CString` that was transferred to C via [`CString::into_raw`](struct.cstring#method.into_raw "CString::into_raw"). Additionally, the length of the string will be recalculated from the pointer. ##### Safety This should only ever be called with a pointer that was earlier obtained by calling [`CString::into_raw`](struct.cstring#method.into_raw "CString::into_raw"). Other usage (e.g., trying to take ownership of a string that was allocated by foreign code) is likely to lead to undefined behavior or allocator corruption. It should be noted that the length isn’t just “recomputed,” but that the recomputed length must match the original length from the [`CString::into_raw`](struct.cstring#method.into_raw "CString::into_raw") call. This means the [`CString::into_raw`](struct.cstring#method.into_raw "CString::into_raw")/`from_raw` methods should not be used when passing the string to C functions that can modify the string’s length. > **Note:** If you need to borrow a string that was allocated by foreign code, use [`CStr`](struct.cstr "CStr"). If you need to take ownership of a string that was allocated by foreign code, you will need to make your own provisions for freeing it appropriately, likely with the foreign code’s API to do that. > > ##### Examples Creates a `CString`, pass ownership to an `extern` function (via raw pointer), then retake ownership with `from_raw`: ⓘ ``` use std::ffi::CString; use std::os::raw::c_char; extern "C" { fn some_extern_function(s: *mut c_char); } let c_string = CString::new("Hello!").expect("CString::new failed"); let raw = c_string.into_raw(); unsafe { some_extern_function(raw); let c_string = CString::from_raw(raw); } ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#450)1.4.0 · #### pub fn into\_raw(self) -> \*mut i8 Consumes the `CString` and transfers ownership of the string to a C caller. The pointer which this function returns must be returned to Rust and reconstituted using [`CString::from_raw`](struct.cstring#method.from_raw "CString::from_raw") to be properly deallocated. Specifically, one should *not* use the standard C `free()` function to deallocate this string. Failure to call [`CString::from_raw`](struct.cstring#method.from_raw "CString::from_raw") will lead to a memory leak. The C side must **not** modify the length of the string (by writing a `null` somewhere inside the string or removing the final one) before it makes it back into Rust using [`CString::from_raw`](struct.cstring#method.from_raw "CString::from_raw"). See the safety section in [`CString::from_raw`](struct.cstring#method.from_raw "CString::from_raw"). ##### Examples ``` use std::ffi::CString; let c_string = CString::new("foo").expect("CString::new failed"); let ptr = c_string.into_raw(); unsafe { assert_eq!(b'f', *ptr as u8); assert_eq!(b'o', *ptr.add(1) as u8); assert_eq!(b'o', *ptr.add(2) as u8); assert_eq!(b'\0', *ptr.add(3) as u8); // retake pointer to free memory let _ = CString::from_raw(ptr); } ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#473)1.7.0 · #### pub fn into\_string(self) -> Result<String, IntoStringError> Converts the `CString` into a [`String`](../string/struct.string "String") if it contains valid UTF-8 data. On failure, ownership of the original `CString` is returned. ##### Examples ``` use std::ffi::CString; let valid_utf8 = vec![b'f', b'o', b'o']; let cstring = CString::new(valid_utf8).expect("CString::new failed"); assert_eq!(cstring.into_string().expect("into_string() call failed"), "foo"); let invalid_utf8 = vec![b'f', 0xff, b'o', b'o']; let cstring = CString::new(invalid_utf8).expect("CString::new failed"); let err = cstring.into_string().err().expect("into_string().err() failed"); assert_eq!(err.utf8_error().valid_up_to(), 1); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#497)1.7.0 · #### pub fn into\_bytes(self) -> Vec<u8, Global> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Consumes the `CString` and returns the underlying byte buffer. The returned buffer does **not** contain the trailing nul terminator, and it is guaranteed to not have any interior nul bytes. ##### Examples ``` use std::ffi::CString; let c_string = CString::new("foo").expect("CString::new failed"); let bytes = c_string.into_bytes(); assert_eq!(bytes, vec![b'f', b'o', b'o']); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#518)1.7.0 · #### pub fn into\_bytes\_with\_nul(self) -> Vec<u8, Global> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Equivalent to [`CString::into_bytes()`](struct.cstring#method.into_bytes "CString::into_bytes()") except that the returned vector includes the trailing nul terminator. ##### Examples ``` use std::ffi::CString; let c_string = CString::new("foo").expect("CString::new failed"); let bytes = c_string.into_bytes_with_nul(); assert_eq!(bytes, vec![b'f', b'o', b'o', b'\0']); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#541)1.0.0 · #### pub fn as\_bytes(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Returns the contents of this `CString` as a slice of bytes. The returned slice does **not** contain the trailing nul terminator, and it is guaranteed to not have any interior nul bytes. If you need the nul terminator, use [`CString::as_bytes_with_nul`](struct.cstring#method.as_bytes_with_nul "CString::as_bytes_with_nul") instead. ##### Examples ``` use std::ffi::CString; let c_string = CString::new("foo").expect("CString::new failed"); let bytes = c_string.as_bytes(); assert_eq!(bytes, &[b'f', b'o', b'o']); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#561)1.0.0 · #### pub fn as\_bytes\_with\_nul(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Equivalent to [`CString::as_bytes()`](struct.cstring#method.as_bytes "CString::as_bytes()") except that the returned slice includes the trailing nul terminator. ##### Examples ``` use std::ffi::CString; let c_string = CString::new("foo").expect("CString::new failed"); let bytes = c_string.as_bytes_with_nul(); assert_eq!(bytes, &[b'f', b'o', b'o', b'\0']); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#580)1.20.0 · #### pub fn as\_c\_str(&self) -> &CStr Extracts a [`CStr`](struct.cstr "CStr") slice containing the entire string. ##### Examples ``` use std::ffi::{CString, CStr}; let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed"); let cstr = c_string.as_c_str(); assert_eq!(cstr, CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed")); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#598)1.20.0 · #### pub fn into\_boxed\_c\_str(self) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts this `CString` into a boxed [`CStr`](struct.cstr "CStr"). ##### Examples ``` use std::ffi::{CString, CStr}; let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed"); let boxed = c_string.into_boxed_c_str(); assert_eq!(&*boxed, CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed")); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#632)1.58.0 · #### pub unsafe fn from\_vec\_with\_nul\_unchecked(v: Vec<u8, Global>) -> CString Converts a `[Vec](../vec/struct.vec "Vec")<[u8](../primitive.u8 "u8")>` to a [`CString`](struct.cstring "CString") without checking the invariants on the given [`Vec`](../vec/struct.vec "Vec"). ##### Safety The given [`Vec`](../vec/struct.vec "Vec") **must** have one nul byte as its last element. This means it cannot be empty nor have any other nul byte anywhere else. ##### Example ``` use std::ffi::CString; assert_eq!( unsafe { CString::from_vec_with_nul_unchecked(b"abc\0".to_vec()) }, unsafe { CString::from_vec_unchecked(b"abc".to_vec()) } ); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#675)1.58.0 · #### pub fn from\_vec\_with\_nul( v: Vec<u8, Global>) -> Result<CString, FromVecWithNulError> Attempts to converts a `[Vec](../vec/struct.vec "Vec")<[u8](../primitive.u8 "u8")>` to a [`CString`](struct.cstring "CString"). Runtime checks are present to ensure there is only one nul byte in the [`Vec`](../vec/struct.vec "Vec"), its last element. ##### Errors If a nul byte is present and not the last element or no nul bytes is present, an error will be returned. ##### Examples A successful conversion will produce the same result as [`CString::new`](struct.cstring#method.new "CString::new") when called without the ending nul byte. ``` use std::ffi::CString; assert_eq!( CString::from_vec_with_nul(b"abc\0".to_vec()) .expect("CString::from_vec_with_nul failed"), CString::new(b"abc".to_vec()).expect("CString::new failed") ); ``` An incorrectly formatted [`Vec`](../vec/struct.vec "Vec") will produce an error. ``` use std::ffi::{CString, FromVecWithNulError}; // Interior nul byte let _: FromVecWithNulError = CString::from_vec_with_nul(b"a\0bc".to_vec()).unwrap_err(); // No nul byte let _: FromVecWithNulError = CString::from_vec_with_nul(b"abc".to_vec()).unwrap_err(); ``` Methods from [Deref](../ops/trait.deref "trait std::ops::Deref")<Target = [CStr](struct.cstr "struct std::ffi::CStr")> ---------------------------------------------------------------------------------------------------------------------- [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#473)1.0.0 · #### pub fn as\_ptr(&self) -> \*const i8 Returns the inner pointer to this C string. The returned pointer will be valid for as long as `self` is, and points to a contiguous region of memory terminated with a 0 byte to represent the end of the string. **WARNING** The returned pointer is read-only; writing to it (including passing it to C code that writes to it) causes undefined behavior. It is your responsibility to make sure that the underlying memory is not freed too early. For example, the following code will cause undefined behavior when `ptr` is used inside the `unsafe` block: ``` use std::ffi::CString; let ptr = CString::new("Hello").expect("CString::new failed").as_ptr(); unsafe { // `ptr` is dangling *ptr; } ``` This happens because the pointer returned by `as_ptr` does not carry any lifetime information and the `CString` is deallocated immediately after the `CString::new("Hello").expect("CString::new failed").as_ptr()` expression is evaluated. To fix the problem, bind the `CString` to a local variable: ``` use std::ffi::CString; let hello = CString::new("Hello").expect("CString::new failed"); let ptr = hello.as_ptr(); unsafe { // `ptr` is valid because `hello` is in scope *ptr; } ``` This way, the lifetime of the `CString` in `hello` encompasses the lifetime of `ptr` and the `unsafe` block. [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#499)1.0.0 · #### pub fn to\_bytes(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this C string to a byte slice. The returned slice will **not** contain the trailing nul terminator that this C string has. > **Note**: This method is currently implemented as a constant-time cast, but it is planned to alter its definition in the future to perform the length calculation whenever this method is called. > > ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_bytes(), b"foo"); ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#527)1.0.0 · #### pub fn to\_bytes\_with\_nul(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this C string to a byte slice containing the trailing 0 byte. This function is the equivalent of [`CStr::to_bytes`](struct.cstr#method.to_bytes "CStr::to_bytes") except that it will retain the trailing nul terminator instead of chopping it off. > **Note**: This method is currently implemented as a 0-cost cast, but it is planned to alter its definition in the future to perform the length calculation whenever this method is called. > > ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_bytes_with_nul(), b"foo\0"); ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#551)1.4.0 · #### pub fn to\_str(&self) -> Result<&str, Utf8Error> Yields a `&[str](../primitive.str "str")` slice if the `CStr` contains valid UTF-8. If the contents of the `CStr` are valid UTF-8 data, this function will return the corresponding `&[str](../primitive.str "str")` slice. Otherwise, it will return an error with details of where UTF-8 validation failed. ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_str(), Ok("foo")); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1102)1.4.0 · #### pub fn to\_string\_lossy(&self) -> Cow<'\_, str> Converts a `CStr` into a `[Cow](../borrow/enum.cow "Cow")<[str](../primitive.str "str")>`. If the contents of the `CStr` are valid UTF-8 data, this function will return a `[Cow](../borrow/enum.cow "Cow")::[Borrowed](../borrow/enum.cow#variant.Borrowed)(&[str](../primitive.str "str"))` with the corresponding `&[str](../primitive.str "str")` slice. Otherwise, it will replace any invalid UTF-8 sequences with [`U+FFFD REPLACEMENT CHARACTER`](../char/constant.replacement_character "std::char::REPLACEMENT_CHARACTER") and return a `[Cow](../borrow/enum.cow "Cow")::[Owned](../borrow/enum.cow#variant.Owned)(&[str](../primitive.str "str"))` with the result. ##### Examples Calling `to_string_lossy` on a `CStr` containing valid UTF-8: ``` use std::borrow::Cow; use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"Hello World\0") .expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_string_lossy(), Cow::Borrowed("Hello World")); ``` Calling `to_string_lossy` on a `CStr` containing invalid UTF-8: ``` use std::borrow::Cow; use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"Hello \xF0\x90\x80World\0") .expect("CStr::from_bytes_with_nul failed"); assert_eq!( cstr.to_string_lossy(), Cow::Owned(String::from("Hello �World")) as Cow<'_, str> ); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1049)1.7.0 · ### impl AsRef<CStr> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1051)#### fn as\_ref(&self) -> &CStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#746)1.3.0 · ### impl Borrow<CStr> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#748)#### fn borrow(&self) -> &CStr Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl Clone for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)#### fn clone(&self) -> CString Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#719)1.0.0 · ### impl Debug for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#720)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#737)1.10.0 · ### impl Default for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#739)#### fn default() -> CString Creates an empty `CString`. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#709)1.0.0 · ### impl Deref for CString #### type Target = CStr The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#713)#### fn deref(&self) -> &CStr Dereferences the value. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#699)1.13.0 · ### impl Drop for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#701)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#856)1.28.0 · ### impl<'a> From<&'a CString> for Cow<'a, CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#859)#### fn from(s: &'a CString) -> Cow<'a, CStr> Converts a `&`[`CString`](struct.cstring "CString") into a borrowed [`Cow`](../borrow/enum.cow "Cow") without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1032)1.7.0 · ### impl From<&CStr> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1033)#### fn from(s: &CStr) -> CString Converts to this type from the input type. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#788)1.18.0 · ### impl From<Box<CStr, Global>> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#791)#### fn from(s: Box<CStr, Global>) -> CString Converts a `[Box](../boxed/struct.box "Box")<[CStr](struct.cstr "CStr")>` into a [`CString`](struct.cstring "CString") without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#866)1.24.0 · ### impl From<CString> for Arc<CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#870)#### fn from(s: CString) -> Arc<CStr> Converts a [`CString`](struct.cstring "CString") into an `[Arc](../sync/struct.arc "Arc")<[CStr](struct.cstr "CStr")>` by moving the [`CString`](struct.cstring "CString") data into a new [`Arc`](../sync/struct.arc "Arc") buffer. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#829)1.20.0 · ### impl From<CString> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#832)#### fn from(s: CString) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`CString`](struct.cstring "CString") into a `[Box](../boxed/struct.box "Box")<[CStr](struct.cstr "CStr")>` without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#838)1.28.0 · ### impl<'a> From<CString> for Cow<'a, CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#841)#### fn from(s: CString) -> Cow<'a, CStr> Converts a [`CString`](struct.cstring "CString") into an owned [`Cow`](../borrow/enum.cow "Cow") without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#889)1.24.0 · ### impl From<CString> for Rc<CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#893)#### fn from(s: CString) -> Rc<CStr> Converts a [`CString`](struct.cstring "CString") into an `[Rc](../rc/struct.rc "Rc")<[CStr](struct.cstr "CStr")>` by moving the [`CString`](struct.cstring "CString") data into a new [`Arc`](../sync/struct.arc "Arc") buffer. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#726)1.7.0 · ### impl From<CString> for Vec<u8, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#731)#### fn from(s: CString) -> Vec<u8, Global> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Converts a [`CString`](struct.cstring "CString") into a `[Vec](../vec/struct.vec "Vec")<[u8](../primitive.u8 "u8")>`. The conversion consumes the [`CString`](struct.cstring "CString"), and removes the terminating NUL byte. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#754)1.28.0 · ### impl<'a> From<Cow<'a, CStr>> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#758)#### fn from(s: Cow<'a, CStr>) -> CString Converts a `Cow<'a, CStr>` into a `CString`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#798)1.43.0 · ### impl From<Vec<NonZeroU8, Global>> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#802)#### fn from(v: Vec<NonZeroU8, Global>) -> CString Converts a `[Vec](../vec/struct.vec "Vec")<[NonZeroU8](../num/struct.nonzerou8 "NonZeroU8")>` into a [`CString`](struct.cstring "CString") without copying nor checking for inner null bytes. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl Hash for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1039)1.7.0 · ### impl Index<RangeFull> for CString #### type Output = CStr The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1043)#### fn index(&self, \_index: RangeFull) -> &CStr Performs the indexing (`container[index]`) operation. [Read more](../ops/trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl Ord for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)#### fn cmp(&self, other: &CString) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl PartialEq<CString> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)#### fn eq(&self, other: &CString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl PartialOrd<CString> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)#### fn partial\_cmp(&self, other: &CString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl Eq for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl StructuralEq for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)### impl StructuralPartialEq for CString Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for CString ### impl Send for CString ### impl Sync for CString ### impl Unpin for CString ### impl UnwindSafe for CString Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::ffi::CStr Struct std::ffi::CStr ===================== ``` pub struct CStr { /* private fields */ } ``` Representation of a borrowed C string. This type represents a borrowed reference to a nul-terminated array of bytes. It can be constructed safely from a `&[[u8](../primitive.u8 "u8")]` slice, or unsafely from a raw `*const c_char`. It can then be converted to a Rust `&[str](../primitive.str "str")` by performing UTF-8 validation, or into an owned `CString`. `&CStr` is to `CString` as `&[str](../primitive.str "str")` is to `String`: the former in each pair are borrowed references; the latter are owned strings. Note that this structure is **not** `repr(C)` and is not recommended to be placed in the signatures of FFI functions. Instead, safe wrappers of FFI functions may leverage the unsafe [`CStr::from_ptr`](struct.cstr#method.from_ptr "CStr::from_ptr") constructor to provide a safe interface to other consumers. Examples -------- Inspecting a foreign C string: ⓘ ``` use std::ffi::CStr; use std::os::raw::c_char; extern "C" { fn my_string() -> *const c_char; } unsafe { let slice = CStr::from_ptr(my_string()); println!("string buffer size without nul terminator: {}", slice.to_bytes().len()); } ``` Passing a Rust-originating C string: ⓘ ``` use std::ffi::{CString, CStr}; use std::os::raw::c_char; fn work(data: &CStr) { extern "C" { fn work_with(data: *const c_char); } unsafe { work_with(data.as_ptr()) } } let s = CString::new("data data data data").expect("CString::new failed"); work(&s); ``` Converting a foreign C string into a Rust `String`: ⓘ ``` use std::ffi::CStr; use std::os::raw::c_char; extern "C" { fn my_string() -> *const c_char; } fn my_string_safe() -> String { let cstr = unsafe { CStr::from_ptr(my_string()) }; // Get copy-on-write Cow<'_, str>, then guarantee a freshly-owned String allocation String::from_utf8_lossy(cstr.to_bytes()).to_string() } println!("string: {}", my_string_safe()); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#188)### impl CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#243)1.0.0 · #### pub unsafe fn from\_ptr<'a>(ptr: \*const i8) -> &'a CStr Wraps a raw C string with a safe C string wrapper. This function will wrap the provided `ptr` with a `CStr` wrapper, which allows inspection and interoperation of non-owned C strings. The total size of the raw C string must be smaller than `isize::MAX` **bytes** in memory due to calling the `slice::from_raw_parts` function. ##### Safety * The memory pointed to by `ptr` must contain a valid nul terminator at the end of the string. * `ptr` must be [valid](../ptr/index#safety) for reads of bytes up to and including the null terminator. This means in particular: + The entire memory range of this `CStr` must be contained within a single allocated object! + `ptr` must be non-null even for a zero-length cstr. * The memory referenced by the returned `CStr` must not be mutated for the duration of lifetime `'a`. > **Note**: This operation is intended to be a 0-cost cast but it is currently implemented with an up-front calculation of the length of the string. This is not guaranteed to always be the case. > > ##### Caveat The lifetime for the returned slice is inferred from its usage. To prevent accidental misuse, it’s suggested to tie the lifetime to whichever source lifetime is safe in the context, such as by providing a helper function taking the lifetime of a host value for the slice, or by explicit annotation. ##### Examples ⓘ ``` use std::ffi::CStr; use std::os::raw::c_char; extern "C" { fn my_string() -> *const c_char; } unsafe { let slice = CStr::from_ptr(my_string()); println!("string returned: {}", slice.to_str().unwrap()); } ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#298)const: [unstable](https://github.com/rust-lang/rust/issues/95027 "Tracking issue for cstr_from_bytes_until_nul") · #### pub fn from\_bytes\_until\_nul( bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError> 🔬This is a nightly-only experimental API. (`cstr_from_bytes_until_nul` [#95027](https://github.com/rust-lang/rust/issues/95027)) Creates a C string wrapper from a byte slice. This method will create a `CStr` from any byte slice that contains at least one nul byte. The caller does not need to know or specify where the nul byte is located. If the first byte is a nul character, this method will return an empty `CStr`. If multiple nul characters are present, the `CStr` will end at the first one. If the slice only has a single nul byte at the end, this method is equivalent to [`CStr::from_bytes_with_nul`](struct.cstr#method.from_bytes_with_nul "CStr::from_bytes_with_nul"). ##### Examples ``` #![feature(cstr_from_bytes_until_nul)] use std::ffi::CStr; let mut buffer = [0u8; 16]; unsafe { // Here we might call an unsafe C function that writes a string // into the buffer. let buf_ptr = buffer.as_mut_ptr(); buf_ptr.write_bytes(b'A', 8); } // Attempt to extract a C nul-terminated string from the buffer. let c_str = CStr::from_bytes_until_nul(&buffer[..]).unwrap(); assert_eq!(c_str.to_str().unwrap(), "AAAAAAAA"); ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#348)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/101719 "Tracking issue for const_cstr_methods")) · #### pub fn from\_bytes\_with\_nul(bytes: &[u8]) -> Result<&CStr, FromBytesWithNulError> Creates a C string wrapper from a byte slice. This function will cast the provided `bytes` to a `CStr` wrapper after ensuring that the byte slice is nul-terminated and does not contain any interior nul bytes. If the nul byte may not be at the end, [`CStr::from_bytes_until_nul`](struct.cstr#method.from_bytes_until_nul "CStr::from_bytes_until_nul") can be used instead. ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"hello\0"); assert!(cstr.is_ok()); ``` Creating a `CStr` without a trailing nul terminator is an error: ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"hello"); assert!(cstr.is_err()); ``` Creating a `CStr` with an interior nul byte is an error: ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"he\0llo\0"); assert!(cstr.is_err()); ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#386)1.10.0 (const: 1.59.0) · #### pub const unsafe fn from\_bytes\_with\_nul\_unchecked(bytes: &[u8]) -> &CStr Unsafely creates a C string wrapper from a byte slice. This function will cast the provided `bytes` to a `CStr` wrapper without performing any sanity checks. ##### Safety The provided slice **must** be nul-terminated and not contain any interior nul bytes. ##### Examples ``` use std::ffi::{CStr, CString}; unsafe { let cstring = CString::new("hello").expect("CString::new failed"); let cstr = CStr::from_bytes_with_nul_unchecked(cstring.to_bytes_with_nul()); assert_eq!(cstr, &*cstring); } ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#473)1.0.0 (const: 1.32.0) · #### pub const fn as\_ptr(&self) -> \*const i8 Returns the inner pointer to this C string. The returned pointer will be valid for as long as `self` is, and points to a contiguous region of memory terminated with a 0 byte to represent the end of the string. **WARNING** The returned pointer is read-only; writing to it (including passing it to C code that writes to it) causes undefined behavior. It is your responsibility to make sure that the underlying memory is not freed too early. For example, the following code will cause undefined behavior when `ptr` is used inside the `unsafe` block: ``` use std::ffi::CString; let ptr = CString::new("Hello").expect("CString::new failed").as_ptr(); unsafe { // `ptr` is dangling *ptr; } ``` This happens because the pointer returned by `as_ptr` does not carry any lifetime information and the `CString` is deallocated immediately after the `CString::new("Hello").expect("CString::new failed").as_ptr()` expression is evaluated. To fix the problem, bind the `CString` to a local variable: ``` use std::ffi::CString; let hello = CString::new("Hello").expect("CString::new failed"); let ptr = hello.as_ptr(); unsafe { // `ptr` is valid because `hello` is in scope *ptr; } ``` This way, the lifetime of the `CString` in `hello` encompasses the lifetime of `ptr` and the `unsafe` block. [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#499)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/101719 "Tracking issue for const_cstr_methods")) · #### pub fn to\_bytes(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this C string to a byte slice. The returned slice will **not** contain the trailing nul terminator that this C string has. > **Note**: This method is currently implemented as a constant-time cast, but it is planned to alter its definition in the future to perform the length calculation whenever this method is called. > > ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_bytes(), b"foo"); ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#527)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/101719 "Tracking issue for const_cstr_methods")) · #### pub fn to\_bytes\_with\_nul(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Converts this C string to a byte slice containing the trailing 0 byte. This function is the equivalent of [`CStr::to_bytes`](struct.cstr#method.to_bytes "CStr::to_bytes") except that it will retain the trailing nul terminator instead of chopping it off. > **Note**: This method is currently implemented as a 0-cost cast, but it is planned to alter its definition in the future to perform the length calculation whenever this method is called. > > ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_bytes_with_nul(), b"foo\0"); ``` [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#551)1.4.0 (const: [unstable](https://github.com/rust-lang/rust/issues/101719 "Tracking issue for const_cstr_methods")) · #### pub fn to\_str(&self) -> Result<&str, Utf8Error> Yields a `&[str](../primitive.str "str")` slice if the `CStr` contains valid UTF-8. If the contents of the `CStr` are valid UTF-8 data, this function will return the corresponding `&[str](../primitive.str "str")` slice. Otherwise, it will return an error with details of where UTF-8 validation failed. ##### Examples ``` use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_str(), Ok("foo")); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1057)### impl CStr [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1102)1.4.0 · #### pub fn to\_string\_lossy(&self) -> Cow<'\_, str> Converts a `CStr` into a `[Cow](../borrow/enum.cow "Cow")<[str](../primitive.str "str")>`. If the contents of the `CStr` are valid UTF-8 data, this function will return a `[Cow](../borrow/enum.cow "Cow")::[Borrowed](../borrow/enum.cow#variant.Borrowed)(&[str](../primitive.str "str"))` with the corresponding `&[str](../primitive.str "str")` slice. Otherwise, it will replace any invalid UTF-8 sequences with [`U+FFFD REPLACEMENT CHARACTER`](../char/constant.replacement_character "std::char::REPLACEMENT_CHARACTER") and return a `[Cow](../borrow/enum.cow "Cow")::[Owned](../borrow/enum.cow#variant.Owned)(&[str](../primitive.str "str"))` with the result. ##### Examples Calling `to_string_lossy` on a `CStr` containing valid UTF-8: ``` use std::borrow::Cow; use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"Hello World\0") .expect("CStr::from_bytes_with_nul failed"); assert_eq!(cstr.to_string_lossy(), Cow::Borrowed("Hello World")); ``` Calling `to_string_lossy` on a `CStr` containing invalid UTF-8: ``` use std::borrow::Cow; use std::ffi::CStr; let cstr = CStr::from_bytes_with_nul(b"Hello \xF0\x90\x80World\0") .expect("CStr::from_bytes_with_nul failed"); assert_eq!( cstr.to_string_lossy(), Cow::Owned(String::from("Hello �World")) as Cow<'_, str> ); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1120)1.20.0 · #### pub fn into\_c\_string(self: Box<CStr, Global>) -> CString Converts a `[Box](../boxed/struct.box "Box")<[CStr](struct.cstr "CStr")>` into a [`CString`](struct.cstring "CString") without copying or allocating. ##### Examples ``` use std::ffi::CString; let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed"); let boxed = c_string.into_boxed_c_str(); assert_eq!(boxed.into_c_string(), CString::new("foo").expect("CString::new failed")); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#604)1.7.0 · ### impl AsRef<CStr> for CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#606)#### fn as\_ref(&self) -> &CStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1049)1.7.0 · ### impl AsRef<CStr> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1051)#### fn as\_ref(&self) -> &CStr Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#746)1.3.0 · ### impl Borrow<CStr> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#748)#### fn borrow(&self) -> &CStr Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#821)1.29.0 · ### impl Clone for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#823)#### fn clone(&self) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#161)1.3.0 · ### impl Debug for CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#162)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#168)1.10.0 · ### impl Default for &CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#169)#### fn default() -> &CStr Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#912)1.17.0 · ### impl Default for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#913)#### fn default() -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#847)1.28.0 · ### impl<'a> From<&'a CStr> for Cow<'a, CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#850)#### fn from(s: &'a CStr) -> Cow<'a, CStr> Converts a [`CStr`](struct.cstr "CStr") into a borrowed [`Cow`](../borrow/enum.cow "Cow") without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#878)1.24.0 · ### impl From<&CStr> for Arc<CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#882)#### fn from(s: &CStr) -> Arc<CStr> Converts a `&CStr` into a `Arc<CStr>`, by copying the contents into a newly allocated [`Arc`](../sync/struct.arc "Arc"). [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#765)1.17.0 · ### impl From<&CStr> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#768)#### fn from(s: &CStr) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `&CStr` into a `Box<CStr>`, by copying the contents into a newly allocated [`Box`](../boxed/struct.box "Box"). [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1032)1.7.0 · ### impl From<&CStr> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1033)#### fn from(s: &CStr) -> CString Converts to this type from the input type. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#900)1.24.0 · ### impl From<&CStr> for Rc<CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#904)#### fn from(s: &CStr) -> Rc<CStr> Converts a `&CStr` into a `Rc<CStr>`, by copying the contents into a newly allocated [`Rc`](../rc/struct.rc "Rc"). [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#829)1.20.0 · ### impl From<CString> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#832)#### fn from(s: CString) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`CString`](struct.cstring "CString") into a `[Box](../boxed/struct.box "Box")<[CStr](struct.cstr "CStr")>` without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#775)1.45.0 · ### impl From<Cow<'\_, CStr>> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#779)#### fn from(cow: Cow<'\_, CStr>) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'a, CStr>` into a `Box<CStr>`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#77)### impl Hash for CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#77)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#582)1.47.0 · ### impl Index<RangeFrom<usize>> for CStr #### type Output = CStr The returned type after indexing. [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#585)#### fn index(&self, index: RangeFrom<usize>) -> &CStr Performs the indexing (`container[index]`) operation. [Read more](../ops/trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#575)1.0.0 · ### impl Ord for CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#576)#### fn cmp(&self, other: &CStr) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#561)1.0.0 · ### impl PartialEq<CStr> for CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#562)#### fn eq(&self, other: &CStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#569)1.0.0 · ### impl PartialOrd<CStr> for CStr [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#570)#### fn partial\_cmp(&self, other: &CStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1017)1.3.0 · ### impl ToOwned for CStr #### type Owned = CString The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1020)#### fn to\_owned(&self) -> CString Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1024)#### fn clone\_into(&self, target: &mut CString) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#567)1.0.0 · ### impl Eq for CStr Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for CStr ### impl Send for CStr ### impl !Sized for CStr ### impl Sync for CStr ### impl Unpin for CStr ### impl UnwindSafe for CStr Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut)
programming_docs
rust Struct std::ffi::FromVecWithNulError Struct std::ffi::FromVecWithNulError ==================================== ``` pub struct FromVecWithNulError { /* private fields */ } ``` An error indicating that a nul byte was not in the expected position. The vector used to create a [`CString`](struct.cstring "CString") must have one and only one nul byte, positioned at the end. This error is created by the [`CString::from_vec_with_nul`](struct.cstring#method.from_vec_with_nul "CString::from_vec_with_nul") method. See its documentation for more. Examples -------- ``` use std::ffi::{CString, FromVecWithNulError}; let _: FromVecWithNulError = CString::from_vec_with_nul(b"f\0oo".to_vec()).unwrap_err(); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#167)1.58.0 · ### impl FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#186)1.58.0 · #### pub fn as\_bytes(&self) -> &[u8] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` Returns a slice of [`u8`](../primitive.u8 "u8")s bytes that were attempted to convert to a [`CString`](struct.cstring "CString"). ##### Examples Basic usage: ``` use std::ffi::CString; // Some invalid bytes in a vector let bytes = b"f\0oo".to_vec(); let value = CString::from_vec_with_nul(bytes.clone()); assert_eq!(&bytes[..], value.unwrap_err().as_bytes()); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#212)1.58.0 · #### pub fn into\_bytes(self) -> Vec<u8, Global> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Returns the bytes that were attempted to convert to a [`CString`](struct.cstring "CString"). This method is carefully constructed to avoid allocation. It will consume the error, moving out the bytes, so that a copy of the bytes does not need to be made. ##### Examples Basic usage: ``` use std::ffi::CString; // Some invalid bytes in a vector let bytes = b"f\0oo".to_vec(); let value = CString::from_vec_with_nul(bytes.clone()); assert_eq!(bytes, value.unwrap_err().into_bytes()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)### impl Clone for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)#### fn clone(&self) -> FromVecWithNulError Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)### impl Debug for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#966)1.58.0 · ### impl Display for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#967)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1136)1.58.0 · ### impl Error for FromVecWithNulError [source](https://doc.rust-lang.org/src/core/error.rs.html#83)1.30.0 · #### fn source(&self) -> Option<&(dyn Error + 'static)> The lower-level source of this error, if any. [Read more](../error/trait.error#method.source) [source](https://doc.rust-lang.org/src/core/error.rs.html#109)1.0.0 · #### fn description(&self) -> &str 👎Deprecated since 1.42.0: use the Display impl or to\_string() [Read more](../error/trait.error#method.description) [source](https://doc.rust-lang.org/src/core/error.rs.html#119)1.0.0 · #### fn cause(&self) -> Option<&dyn Error> 👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting [source](https://doc.rust-lang.org/src/core/error.rs.html#193)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`error_generic_member_access` [#99301](https://github.com/rust-lang/rust/issues/99301)) Provides type based access to context intended for error reports. [Read more](../error/trait.error#method.provide) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)### impl PartialEq<FromVecWithNulError> for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)#### fn eq(&self, other: &FromVecWithNulError) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)### impl Eq for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)### impl StructuralEq for FromVecWithNulError [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)### impl StructuralPartialEq for FromVecWithNulError Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for FromVecWithNulError ### impl Send for FromVecWithNulError ### impl Sync for FromVecWithNulError ### impl Unpin for FromVecWithNulError ### impl UnwindSafe for FromVecWithNulError Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/error.rs.html#197)### impl<E> Provider for Ewhere E: [Error](../error/trait.error "trait std::error::Error") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/error.rs.html#201)#### fn provide(&'a self, demand: &mut Demand<'a>) 🔬This is a nightly-only experimental API. (`provide_any` [#96024](https://github.com/rust-lang/rust/issues/96024)) Data providers should implement this method to provide *all* values they are able to provide by using `demand`. [Read more](../any/trait.provider#tymethod.provide) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Type Definition std::ffi::c_long Type Definition std::ffi::c\_long ================================= ``` pub type c_long = i64; ``` Equivalent to C’s `signed long` (`long`) type. This type will always be [`i32`](../primitive.i32 "i32") or [`i64`](../primitive.i64 "i64"). Most notably, many Linux-based systems assume an `i64`, but Windows assumes `i32`. The C standard technically only requires that this type be a signed integer that is at least 32 bits and at least the size of an [`int`](type.c_int), although in practice, no system would have a `long` that is neither an `i32` nor `i64`. rust Enum std::ffi::c_void Enum std::ffi::c\_void ====================== ``` #[repr(u8)] pub enum c_void { // some variants omitted } ``` Equivalent to C’s `void` type when used as a [pointer](../primitive.pointer "pointer"). In essence, `*const c_void` is equivalent to C’s `const void*` and `*mut c_void` is equivalent to C’s `void*`. That said, this is *not* the same as C’s `void` return type, which is Rust’s `()` type. To model pointers to opaque types in FFI, until `extern type` is stabilized, it is recommended to use a newtype wrapper around an empty byte array. See the [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs) for details. One could use `std::os::raw::c_void` if they want to support old Rust compiler down to 1.1.0. After Rust 1.30.0, it was re-exported by this definition. For more information, please read [RFC 2521](https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md). Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#221)1.16.0 · ### impl Debug for c\_void [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#222)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for c\_void ### impl Send for c\_void ### impl Sync for c\_void ### impl Unpin for c\_void ### impl UnwindSafe for c\_void Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::borrow Module std::borrow ================== A module for working with borrowed data. Enums ----- [Cow](enum.cow "std::borrow::Cow enum") A clone-on-write smart pointer. Traits ------ [Borrow](trait.borrow "std::borrow::Borrow trait") A trait for borrowing data. [BorrowMut](trait.borrowmut "std::borrow::BorrowMut trait") A trait for mutably borrowing data. [ToOwned](trait.toowned "std::borrow::ToOwned trait") A generalization of `Clone` to borrowed data. rust Trait std::borrow::ToOwned Trait std::borrow::ToOwned ========================== ``` pub trait ToOwned { type Owned: Borrow<Self>; fn to_owned(&self) -> Self::Owned; fn clone_into(&self, target: &mut Self::Owned) { ... } } ``` A generalization of `Clone` to borrowed data. Some types make it possible to go from borrowed to owned, usually by implementing the `Clone` trait. But `Clone` works only for going from `&T` to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data from any borrow of a given type. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#42)#### type Owned: Borrow<Self> The resulting type after obtaining ownership. Required Methods ---------------- [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#59)#### fn to\_owned(&self) -> Self::Owned Creates owned data from borrowed data, usually by cloning. ##### Examples Basic usage: ``` let s: &str = "a"; let ss: String = s.to_owned(); let v: &[i32] = &[1, 2]; let vv: Vec<i32> = v.to_owned(); ``` Provided Methods ---------------- [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#77)1.63.0 · #### fn clone\_into(&self, target: &mut Self::Owned) Uses borrowed data to replace owned data, usually by cloning. This is borrow-generalized version of [`Clone::clone_from`](../clone/trait.clone#method.clone_from "Clone::clone_from"). ##### Examples Basic usage: ``` let mut s: String = String::new(); "hello".clone_into(&mut s); let mut v: Vec<i32> = Vec::new(); [1, 2][..].clone_into(&mut v); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/str.rs.html#205)### impl ToOwned for str #### type Owned = String [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1017)1.3.0 · ### impl ToOwned for CStr #### type Owned = CString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1290-1300)### impl ToOwned for OsStr #### type Owned = OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#1833-1843)### impl ToOwned for Path #### type Owned = PathBuf [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#784)### impl<T> ToOwned for [T]where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = Vec<T, Global> [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T rust Enum std::borrow::Cow Enum std::borrow::Cow ===================== ``` pub enum Cow<'a, B>where    B: 'a + ToOwned + ?Sized,{ Borrowed(&'a B), Owned(<B as ToOwned>::Owned), } ``` A clone-on-write smart pointer. The type `Cow` is a smart pointer providing clone-on-write functionality: it can enclose and provide immutable access to borrowed data, and clone the data lazily when mutation or ownership is required. The type is designed to work with general borrowed data via the `Borrow` trait. `Cow` implements `Deref`, which means that you can call non-mutating methods directly on the data it encloses. If mutation is desired, `to_mut` will obtain a mutable reference to an owned value, cloning if necessary. If you need reference-counting pointers, note that [`Rc::make_mut`](../rc/struct.rc#method.make_mut "crate::rc::Rc::make_mut") and [`Arc::make_mut`](../sync/struct.arc#method.make_mut "crate::sync::Arc::make_mut") can provide clone-on-write functionality as well. Examples -------- ``` use std::borrow::Cow; fn abs_all(input: &mut Cow<[i32]>) { for i in 0..input.len() { let v = input[i]; if v < 0 { // Clones into a vector if not already owned. input.to_mut()[i] = -v; } } } // No clone occurs because `input` doesn't need to be mutated. let slice = [0, 1, 2]; let mut input = Cow::from(&slice[..]); abs_all(&mut input); // Clone occurs because `input` needs to be mutated. let slice = [-1, 0, 1]; let mut input = Cow::from(&slice[..]); abs_all(&mut input); // No clone occurs because `input` is already owned. let mut input = Cow::from(vec![-1, 0, 1]); abs_all(&mut input); ``` Another example showing how to keep `Cow` in a struct: ``` use std::borrow::Cow; struct Items<'a, X: 'a> where [X]: ToOwned<Owned = Vec<X>> { values: Cow<'a, [X]>, } impl<'a, X: Clone + 'a> Items<'a, X> where [X]: ToOwned<Owned = Vec<X>> { fn new(v: Cow<'a, [X]>) -> Self { Items { values: v } } } // Creates a container from borrowed values of a slice let readonly = [1, 2]; let borrowed = Items::new((&readonly[..]).into()); match borrowed { Items { values: Cow::Borrowed(b) } => println!("borrowed {b:?}"), _ => panic!("expect borrowed value"), } let mut clone_on_write = borrowed; // Mutates the data from slice into owned vec and pushes a new value on top clone_on_write.values.to_mut().push(3); println!("clone_on_write = {:?}", clone_on_write.values); // The data was mutated. Let's check it out. match clone_on_write { Items { values: Cow::Owned(_) } => println!("clone_on_write contains owned data"), _ => panic!("expect owned data"), } ``` Variants -------- ### `Borrowed([&'a](../primitive.reference) B)` Borrowed data. ### `Owned(<B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"))` Owned data. Implementations --------------- [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#213)### impl<B> Cow<'\_, B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#230)const: [unstable](https://github.com/rust-lang/rust/issues/65143 "Tracking issue for const_cow_is_borrowed") · #### pub fn is\_borrowed(&self) -> bool 🔬This is a nightly-only experimental API. (`cow_is_borrowed` [#65143](https://github.com/rust-lang/rust/issues/65143)) Returns true if the data is borrowed, i.e. if `to_mut` would require additional work. ##### Examples ``` #![feature(cow_is_borrowed)] use std::borrow::Cow; let cow = Cow::Borrowed("moo"); assert!(cow.is_borrowed()); let bull: Cow<'_, str> = Cow::Owned("...moo?".to_string()); assert!(!bull.is_borrowed()); ``` [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#253)const: [unstable](https://github.com/rust-lang/rust/issues/65143 "Tracking issue for const_cow_is_borrowed") · #### pub fn is\_owned(&self) -> bool 🔬This is a nightly-only experimental API. (`cow_is_borrowed` [#65143](https://github.com/rust-lang/rust/issues/65143)) Returns true if the data is owned, i.e. if `to_mut` would be a no-op. ##### Examples ``` #![feature(cow_is_borrowed)] use std::borrow::Cow; let cow: Cow<'_, str> = Cow::Owned("moo".to_string()); assert!(cow.is_owned()); let bull = Cow::Borrowed("...moo?"); assert!(!bull.is_owned()); ``` [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#275)#### pub fn to\_mut(&mut self) -> &mut <B as ToOwned>::Owned Acquires a mutable reference to the owned form of the data. Clones the data if it is not already owned. ##### Examples ``` use std::borrow::Cow; let mut cow = Cow::Borrowed("foo"); cow.to_mut().make_ascii_uppercase(); assert_eq!( cow, Cow::Owned(String::from("FOO")) as Cow<str> ); ``` [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#323)#### pub fn into\_owned(self) -> <B as ToOwned>::Owned Extracts the owned data. Clones the data if it is not already owned. ##### Examples Calling `into_owned` on a `Cow::Borrowed` returns a clone of the borrowed data: ``` use std::borrow::Cow; let s = "Hello world!"; let cow = Cow::Borrowed(s); assert_eq!( cow.into_owned(), String::from(s) ); ``` Calling `into_owned` on a `Cow::Owned` returns the owned data. The data is moved out of the `Cow` without being cloned. ``` use std::borrow::Cow; let s = "Hello world!"; let cow: Cow<str> = Cow::Owned(String::from(s)); assert_eq!( cow.into_owned(), String::from(s) ); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#441)1.14.0 · ### impl<'a> Add<&'a str> for Cow<'a, str> #### type Output = Cow<'a, str> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#445)#### fn add(self, rhs: &'a str) -> <Cow<'a, str> as Add<&'a str>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#453)1.14.0 · ### impl<'a> Add<Cow<'a, str>> for Cow<'a, str> #### type Output = Cow<'a, str> The resulting type after applying the `+` operator. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#457)#### fn add(self, rhs: Cow<'a, str>) -> <Cow<'a, str> as Add<Cow<'a, str>>>::Output Performs the `+` operation. [Read more](../ops/trait.add#tymethod.add) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#465)1.14.0 · ### impl<'a> AddAssign<&'a str> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#466)#### fn add\_assign(&mut self, rhs: &'a str) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#482)1.14.0 · ### impl<'a> AddAssign<Cow<'a, str>> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#483)#### fn add\_assign(&mut self, rhs: Cow<'a, str>) Performs the `+=` operation. [Read more](../ops/trait.addassign#tymethod.add_assign) [source](https://doc.rust-lang.org/src/std/path.rs.html#3017-3022)1.8.0 · ### impl AsRef<Path> for Cow<'\_, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3019-3021)#### fn as\_ref(&self) -> &Path Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#433)### impl<T> AsRef<T> for Cow<'\_, T>where T: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#434)#### fn as\_ref(&self) -> &T Converts this type into a shared reference of the (usually inferred) input type. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#21)### impl<'a, B> Borrow<B> for Cow<'a, B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): 'a, [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#26)#### fn borrow(&self) -> &B Immutably borrows from an owned value. [Read more](trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#194)### impl<B> Clone for Cow<'\_, B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#195)#### fn clone(&self) -> Cow<'\_, B> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#205)#### fn clone\_from(&mut self, source: &Cow<'\_, B>) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#385)### impl<B> Debug for Cow<'\_, B>where B: [Debug](../fmt/trait.debug "trait std::fmt::Debug") + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#389)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#411)1.11.0 · ### impl<B> Default for Cow<'\_, B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#416)#### fn default() -> Cow<'\_, B> Creates an owned Cow<’a, B> with the default value for the contained owned value. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#333)const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref") · ### impl<B> Deref for Cow<'\_, B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Borrow](trait.borrow "trait std::borrow::Borrow")<B>, #### type Target = B The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#339)const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref") · #### fn deref(&self) -> &B Dereferences the value. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#398)### impl<B> Display for Cow<'\_, B>where B: [Display](../fmt/trait.display "trait std::fmt::Display") + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Display](../fmt/trait.display "trait std::fmt::Display"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#402)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1386-1393)1.52.0 · ### impl<'a> Extend<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1388-1392)#### fn extend<T: IntoIterator<Item = Cow<'a, OsStr>>>(&mut self, iter: T) Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#371)#### fn extend\_one(&mut self, item: A) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2128)1.19.0 · ### impl<'a> Extend<Cow<'a, str>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2129)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [Cow](enum.cow "enum std::borrow::Cow")<'a, [str](../primitive.str)>>, Extends a collection with the contents of an iterator. [Read more](../iter/trait.extend#tymethod.extend) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2134)#### fn extend\_one(&mut self, s: Cow<'a, str>) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Extends a collection with exactly one element. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#379)#### fn extend\_reserve(&mut self, additional: usize) 🔬This is a nightly-only experimental API. (`extend_one` [#72631](https://github.com/rust-lang/rust/issues/72631)) Reserves capacity in a collection for the given number of additional elements. [Read more](../iter/trait.extend#method.extend_reserve) [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#7)1.8.0 · ### impl<'a, T> From<&'a [T]> for Cow<'a, [T]>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#14)#### fn from(s: &'a [T]) -> Cow<'a, [T]> Creates a [`Borrowed`](enum.cow#variant.Borrowed) variant of [`Cow`](enum.cow "Cow") from a slice. This conversion does not allocate or clone the data. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#847)1.28.0 · ### impl<'a> From<&'a CStr> for Cow<'a, CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#850)#### fn from(s: &'a CStr) -> Cow<'a, CStr> Converts a [`CStr`](../ffi/struct.cstr "CStr") into a borrowed [`Cow`](enum.cow "Cow") without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#856)1.28.0 · ### impl<'a> From<&'a CString> for Cow<'a, CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#859)#### fn from(s: &'a CString) -> Cow<'a, CStr> Converts a `&`[`CString`](../ffi/struct.cstring "CString") into a borrowed [`Cow`](enum.cow "Cow") without copying or allocating. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1086-1092)1.28.0 · ### impl<'a> From<&'a OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1089-1091)#### fn from(s: &'a OsStr) -> Cow<'a, OsStr> Converts the string reference into a [`Cow::Borrowed`](enum.cow#variant.Borrowed "Cow::Borrowed"). [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1095-1101)1.28.0 · ### impl<'a> From<&'a OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1098-1100)#### fn from(s: &'a OsString) -> Cow<'a, OsStr> Converts the string reference into a [`Cow::Borrowed`](enum.cow#variant.Borrowed "Cow::Borrowed"). [source](https://doc.rust-lang.org/src/std/path.rs.html#1744-1753)1.6.0 · ### impl<'a> From<&'a Path> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1750-1752)#### fn from(s: &'a Path) -> Cow<'a, Path> Creates a clone-on-write pointer from a reference to [`Path`](../path/struct.path "Path"). This conversion does not clone or allocate. [source](https://doc.rust-lang.org/src/std/path.rs.html#1768-1777)1.28.0 · ### impl<'a> From<&'a PathBuf> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1774-1776)#### fn from(p: &'a PathBuf) -> Cow<'a, Path> Creates a clone-on-write pointer from a reference to [`PathBuf`](../path/struct.pathbuf "PathBuf"). This conversion does not clone or allocate. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2769)1.28.0 · ### impl<'a> From<&'a String> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2784)#### fn from(s: &'a String) -> Cow<'a, str> Converts a [`String`](../string/struct.string "String") reference into a [`Borrowed`](enum.cow#variant.Borrowed "borrow::Cow::Borrowed") variant. No heap allocation is performed, and the string is not copied. ##### Example ``` let s = "eggplant".to_string(); assert_eq!(Cow::from(&s), Cow::Borrowed("eggplant")); ``` [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#33)1.28.0 · ### impl<'a, T> From<&'a Vec<T, Global>> for Cow<'a, [T]>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#40)#### fn from(v: &'a Vec<T, Global>) -> Cow<'a, [T]> Creates a [`Borrowed`](enum.cow#variant.Borrowed) variant of [`Cow`](enum.cow "Cow") from a reference to [`Vec`](../vec/struct.vec "Vec"). This conversion does not allocate or clone the data. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2725)### impl<'a> From<&'a str> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2739)#### fn from(s: &'a str) -> Cow<'a, str> Converts a string slice into a [`Borrowed`](enum.cow#variant.Borrowed "borrow::Cow::Borrowed") variant. No heap allocation is performed, and the string is not copied. ##### Example ``` assert_eq!(Cow::from("eggplant"), Cow::Borrowed("eggplant")); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#838)1.28.0 · ### impl<'a> From<CString> for Cow<'a, CStr> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#841)#### fn from(s: CString) -> Cow<'a, CStr> Converts a [`CString`](../ffi/struct.cstring "CString") into an owned [`Cow`](enum.cow "Cow") without copying or allocating. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1510)1.45.0 · ### impl<T> From<Cow<'\_, [T]>> for Box<[T], Global>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1518)#### fn from(cow: Cow<'\_, [T]>) -> Box<[T], Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'_, [T]>` into a `Box<[T]>` When `cow` is the `Cow::Borrowed` variant, this conversion allocates on the heap and copies the underlying slice. Otherwise, it will try to reuse the owned `Vec`’s allocation. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#775)1.45.0 · ### impl From<Cow<'\_, CStr>> for Box<CStr, Global> [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#779)#### fn from(cow: Cow<'\_, CStr>) -> Box<CStr, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'a, CStr>` into a `Box<CStr>`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#995-1005)1.45.0 · ### impl From<Cow<'\_, OsStr>> for Box<OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#999-1004)#### fn from(cow: Cow<'\_, OsStr>) -> Box<OsStr> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'a, OsStr>` into a `[Box](../boxed/struct.box "Box")<[OsStr](../ffi/struct.osstr "OsStr")>`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/path.rs.html#1592-1603)1.45.0 · ### impl From<Cow<'\_, Path>> for Box<Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1597-1602)#### fn from(cow: Cow<'\_, Path>) -> Box<Path> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Creates a boxed [`Path`](../path/struct.path "Path") from a clone-on-write pointer. Converting from a `Cow::Owned` does not clone or allocate. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1548)1.45.0 · ### impl From<Cow<'\_, str>> for Box<str, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1573)#### fn from(cow: Cow<'\_, str>) -> Box<str, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a `Cow<'_, str>` into a `Box<str>` When `cow` is the `Cow::Borrowed` variant, this conversion allocates on the heap and copies the underlying `str`. Otherwise, it will try to reuse the owned `String`’s allocation. ##### Examples ``` use std::borrow::Cow; let unboxed = Cow::Borrowed("hello"); let boxed: Box<str> = Box::from(unboxed); println!("{boxed}"); ``` ``` let unboxed = Cow::Owned("hello".to_string()); let boxed: Box<str> = Box::from(unboxed); println!("{boxed}"); ``` [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3038)1.14.0 · ### impl<'a, T> From<Cow<'a, [T]>> for Vec<T, Global>where [[T]](../primitive.slice): [ToOwned](trait.toowned "trait std::borrow::ToOwned"), <[[T]](../primitive.slice) as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned") == [Vec](../vec/struct.vec "struct std::vec::Vec")<T, [Global](../alloc/struct.global "struct std::alloc::Global")>, [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#3056)#### fn from(s: Cow<'a, [T]>) -> Vec<T, Global> Notable traits for [Vec](../vec/struct.vec "struct std::vec::Vec")<[u8](../primitive.u8), A> ``` impl<A: Allocator> Write for Vec<u8, A> ``` Convert a clone-on-write slice into a vector. If `s` already owns a `Vec<T>`, it will be returned directly. If `s` is borrowing a slice, a new `Vec<T>` will be allocated and filled by cloning `s`’s items into it. ##### Examples ``` let o: Cow<[i32]> = Cow::Owned(vec![1, 2, 3]); let b: Cow<[i32]> = Cow::Borrowed(&[1, 2, 3]); assert_eq!(Vec::from(o), Vec::from(b)); ``` [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2585)1.45.0 · ### impl<'a, B> From<Cow<'a, B>> for Arc<B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [Arc](../sync/struct.arc "struct std::sync::Arc")<B>: [From](../convert/trait.from "trait std::convert::From")<[&'a](../primitive.reference) B>, [Arc](../sync/struct.arc "struct std::sync::Arc")<B>: [From](../convert/trait.from "trait std::convert::From")<<B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned")>, [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2603)#### fn from(cow: Cow<'a, B>) -> Arc<B> Create an atomically reference-counted pointer from a clone-on-write pointer by copying its content. ##### Example ``` let cow: Cow<str> = Cow::Borrowed("eggplant"); let shared: Arc<str> = Arc::from(cow); assert_eq!("eggplant", &shared[..]); ``` [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1981)1.45.0 · ### impl<'a, B> From<Cow<'a, B>> for Rc<B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [Rc](../rc/struct.rc "struct std::rc::Rc")<B>: [From](../convert/trait.from "trait std::convert::From")<[&'a](../primitive.reference) B>, [Rc](../rc/struct.rc "struct std::rc::Rc")<B>: [From](../convert/trait.from "trait std::convert::From")<<B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned")>, [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1999)#### fn from(cow: Cow<'a, B>) -> Rc<B> Create a reference-counted pointer from a clone-on-write pointer by copying its content. ##### Example ``` let cow: Cow<str> = Cow::Borrowed("eggplant"); let shared: Rc<str> = Rc::from(cow); assert_eq!("eggplant", &shared[..]); ``` [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#754)1.28.0 · ### impl<'a> From<Cow<'a, CStr>> for CString [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#758)#### fn from(s: Cow<'a, CStr>) -> CString Converts a `Cow<'a, CStr>` into a `CString`, by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1104-1111)1.28.0 · ### impl<'a> From<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1108-1110)#### fn from(s: Cow<'a, OsStr>) -> Self Converts a `Cow<'a, OsStr>` into an [`OsString`](../ffi/struct.osstring "OsString"), by copying the contents if they are borrowed. [source](https://doc.rust-lang.org/src/std/path.rs.html#1780-1788)1.28.0 · ### impl<'a> From<Cow<'a, Path>> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#1785-1787)#### fn from(p: Cow<'a, Path>) -> Self Converts a clone-on-write pointer to an owned path. Converting from a `Cow::Owned` does not clone or allocate. [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2358)1.22.0 · ### impl<'a> From<Cow<'a, str>> for Box<dyn Error + 'static, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2372)#### fn from(err: Cow<'a, str>) -> Box<dyn Error + 'static, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`Cow`](enum.cow "Cow") into a box of dyn [`Error`](../error/trait.error "Error"). ##### 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>::from(a_cow_str_error); assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error)) ``` [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2701)1.14.0 · ### impl<'a> From<Cow<'a, str>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2718)#### fn from(s: Cow<'a, str>) -> String Converts a clone-on-write string to an owned instance of [`String`](../string/struct.string "String"). This extracts the owned string, clones the string if it is not already owned. ##### Example ``` // If the string is not owned... let cow: Cow<str> = Cow::Borrowed("eggplant"); // It will allocate on the heap and copy the string. let owned: String = String::from(cow); assert_eq!(&owned[..], "eggplant"); ``` [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2335)1.22.0 · ### impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a, Global> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2350)#### fn from(err: Cow<'b, str>) -> Box<dyn Error + Send + Sync + 'a, Global> Notable traits for [Box](../boxed/struct.box "struct std::boxed::Box")<I, A> ``` impl<I, A> Iterator for Box<I, A>where     I: Iterator + ?Sized,     A: Allocator, type Item = <I as Iterator>::Item; impl<F, A> Future for Box<F, A>where     F: Future + Unpin + ?Sized,     A: Allocator + 'static, type Output = <F as Future>::Output; impl<R: Read + ?Sized> Read for Box<R> impl<W: Write + ?Sized> Write for Box<W> ``` Converts a [`Cow`](enum.cow "Cow") into a box of dyn [`Error`](../error/trait.error "Error") + [`Send`](../marker/trait.send "Send") + [`Sync`](../marker/trait.sync "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)) ``` [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1077-1083)1.28.0 · ### impl<'a> From<OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1080-1082)#### fn from(s: OsString) -> Cow<'a, OsStr> Moves the string into a [`Cow::Owned`](enum.cow#variant.Owned "Cow::Owned"). [source](https://doc.rust-lang.org/src/std/path.rs.html#1756-1765)1.6.0 · ### impl<'a> From<PathBuf> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#1762-1764)#### fn from(s: PathBuf) -> Cow<'a, Path> Creates a clone-on-write pointer from an owned instance of [`PathBuf`](../path/struct.pathbuf "PathBuf"). This conversion does not clone or allocate. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2746)### impl<'a> From<String> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2762)#### fn from(s: String) -> Cow<'a, str> Converts a [`String`](../string/struct.string "String") into an [`Owned`](enum.cow#variant.Owned "borrow::Cow::Owned") variant. No heap allocation is performed, and the string is not copied. ##### Example ``` let s = "eggplant".to_string(); let s2 = "eggplant".to_string(); assert_eq!(Cow::from(s), Cow::<'static, str>::Owned(s2)); ``` [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#20)1.8.0 · ### impl<'a, T> From<Vec<T, Global>> for Cow<'a, [T]>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#27)#### fn from(v: Vec<T, Global>) -> Cow<'a, [T]> Creates an [`Owned`](enum.cow#variant.Owned) variant of [`Cow`](enum.cow "Cow") from an owned instance of [`Vec`](../vec/struct.vec "Vec"). This conversion does not allocate or clone the data. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2799)1.12.0 · ### impl<'a, 'b> FromIterator<&'b str> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2800)#### fn from\_iter<I>(it: I) -> Cow<'a, str>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = &'b [str](../primitive.str)>, Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1427-1448)1.52.0 · ### impl<'a> FromIterator<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1429-1447)#### fn from\_iter<I: IntoIterator<Item = Cow<'a, OsStr>>>(iter: I) -> Self Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2035)1.19.0 · ### impl<'a> FromIterator<Cow<'a, str>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2036)#### fn from\_iter<I>(iter: I) -> Stringwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [Cow](enum.cow "enum std::borrow::Cow")<'a, [str](../primitive.str)>>, Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2807)1.12.0 · ### impl<'a> FromIterator<String> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2808)#### fn from\_iter<I>(it: I) -> Cow<'a, str>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [String](../string/struct.string "struct std::string::String")>, Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#46)### impl<'a, T> FromIterator<T> for Cow<'a, [T]>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/cow.rs.html#50)#### fn from\_iter<I>(it: I) -> Cow<'a, [T]>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = T>, Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2791)1.12.0 · ### impl<'a> FromIterator<char> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2792)#### fn from\_iter<I>(it: I) -> Cow<'a, str>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [char](../primitive.char)>, Creates a value from an iterator. [Read more](../iter/trait.fromiterator#tymethod.from_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#422)### impl<B> Hash for Cow<'\_, B>where B: [Hash](../hash/trait.hash "trait std::hash::Hash") + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#427)#### fn hash<H>(&self, state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#351)### impl<B> Ord for Cow<'\_, B>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#356)#### fn cmp(&self, other: &Cow<'\_, B>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)1.8.0 · ### impl<'a, 'b> PartialEq<&'a Path> for Cow<'b, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)#### fn eq(&self, other: &&'a Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn eq(&self, other: &&'b OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn eq(&self, other: &&'b OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)1.6.0 · ### impl<'a, 'b> PartialEq<&'b Path> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)#### fn eq(&self, other: &&'b Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2231)### impl<'a, 'b> PartialEq<&'b str> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2231)#### fn eq(&self, other: &&'b str) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2231)#### fn ne(&self, other: &&'b str) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#33)### impl<T, U> PartialEq<&[U]> for Cow<'\_, [T]>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U> + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#33)#### fn eq(&self, other: &&[U]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#33)#### fn ne(&self, other: &&[U]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#35)### impl<T, U> PartialEq<&mut [U]> for Cow<'\_, [T]>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U> + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#35)#### fn eq(&self, other: &&mut [U]) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#35)#### fn ne(&self, other: &&mut [U]) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)#### fn eq(&self, other: &Cow<'a, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)1.6.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)1.6.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)1.6.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)#### fn eq(&self, other: &Cow<'a, Path>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2231)### impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b str [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2231)#### fn eq(&self, other: &Cow<'a, str>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2231)#### fn ne(&self, other: &Cow<'a, str>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2233)### impl<'a, 'b> PartialEq<Cow<'a, str>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2233)#### fn eq(&self, other: &Cow<'a, str>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2233)#### fn ne(&self, other: &Cow<'a, str>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2229)### impl<'a, 'b> PartialEq<Cow<'a, str>> for str [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2229)#### fn eq(&self, other: &Cow<'a, str>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2229)#### fn ne(&self, other: &Cow<'a, str>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#362)### impl<'a, 'b, B, C> PartialEq<Cow<'b, C>> for Cow<'a, B>where B: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<C> + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), C: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#368)#### fn eq(&self, other: &Cow<'b, C>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'b, OsStr>> for &'a Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)#### fn eq(&self, other: &Cow<'b, OsStr>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn eq(&self, other: &OsStr) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn eq(&self, other: &OsString) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)1.8.0 · ### impl<'a, 'b> PartialEq<Path> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)#### fn eq(&self, other: &Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)1.6.0 · ### impl<'a, 'b> PartialEq<Path> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)#### fn eq(&self, other: &Path) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)1.8.0 · ### impl<'a, 'b> PartialEq<PathBuf> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)#### fn eq(&self, other: &PathBuf) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)1.6.0 · ### impl<'a, 'b> PartialEq<PathBuf> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)#### fn eq(&self, other: &PathBuf) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2233)### impl<'a, 'b> PartialEq<String> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2233)#### fn eq(&self, other: &String) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2233)#### fn ne(&self, other: &String) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#31)### impl<T, U, A> PartialEq<Vec<U, A>> for Cow<'\_, [T]>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<U> + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#31)#### fn eq(&self, other: &Vec<U, A>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/vec/partial_eq.rs.html#31)#### fn ne(&self, other: &Vec<U, A>) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2229)### impl<'a, 'b> PartialEq<str> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2229)#### fn eq(&self, other: &str) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2229)#### fn ne(&self, other: &str) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a Path> for Cow<'b, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)#### fn partial\_cmp(&self, other: &&'a Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn partial\_cmp(&self, other: &&'b OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn partial\_cmp(&self, other: &&'b OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)1.8.0 · ### impl<'a, 'b> PartialOrd<&'b Path> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)#### fn partial\_cmp(&self, other: &&'b Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#374)### impl<'a, B> PartialOrd<Cow<'a, B>> for Cow<'a, B>where B: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<B> + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#379)#### fn partial\_cmp(&self, other: &Cow<'a, B>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1240)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)#### fn partial\_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3166)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3115)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for PathBuf [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)#### fn partial\_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'b, OsStr>> for &'a Path [source](https://doc.rust-lang.org/src/std/path.rs.html#3163)#### fn partial\_cmp(&self, other: &Cow<'b, OsStr>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1239)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3165)#### fn partial\_cmp(&self, other: &OsStr) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1241)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3167)#### fn partial\_cmp(&self, other: &OsString) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3160)#### fn partial\_cmp(&self, other: &Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3114)#### fn partial\_cmp(&self, other: &Path) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, OsStr> [source](https://doc.rust-lang.org/src/std/path.rs.html#3156)#### fn partial\_cmp(&self, other: &PathBuf) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, Path> [source](https://doc.rust-lang.org/src/std/path.rs.html#3116)#### fn partial\_cmp(&self, other: &PathBuf) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)#### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)#### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)#### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)#### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2579)1.17.0 · ### impl ToString for Cow<'\_, str> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2581)#### fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#348)### impl<B> Eq for Cow<'\_, B>where B: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<'a, B: ?Sized> RefUnwindSafe for Cow<'a, B>where B: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, B: ?Sized> Send for Cow<'a, B>where B: [Sync](../marker/trait.sync "trait std::marker::Sync"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Send](../marker/trait.send "trait std::marker::Send"), ### impl<'a, B: ?Sized> Sync for Cow<'a, B>where B: [Sync](../marker/trait.sync "trait std::marker::Sync"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<'a, B: ?Sized> Unpin for Cow<'a, B>where <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<'a, B: ?Sized> UnwindSafe for Cow<'a, B>where B: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Trait std::borrow::Borrow Trait std::borrow::Borrow ========================= ``` pub trait Borrow<Borrowed>where    Borrowed: ?Sized,{ fn borrow(&self) -> &Borrowed; } ``` A trait for borrowing data. In Rust, it is common to provide different representations of a type for different use cases. For instance, storage location and management for a value can be specifically chosen as appropriate for a particular use via pointer types such as [`Box<T>`](../boxed/struct.box) or [`Rc<T>`](../rc/struct.rc). Beyond these generic wrappers that can be used with any type, some types provide optional facets providing potentially costly functionality. An example for such a type is [`String`](../string/struct.string) which adds the ability to extend a string to the basic [`str`](../primitive.str "str"). This requires keeping additional information unnecessary for a simple, immutable string. These types provide access to the underlying data through references to the type of that data. They are said to be ‘borrowed as’ that type. For instance, a [`Box<T>`](../boxed/struct.box) can be borrowed as `T` while a [`String`](../string/struct.string) can be borrowed as `str`. Types express that they can be borrowed as some type `T` by implementing `Borrow<T>`, providing a reference to a `T` in the trait’s [`borrow`](trait.borrow#tymethod.borrow) method. A type is free to borrow as several different types. If it wishes to mutably borrow as the type – allowing the underlying data to be modified, it can additionally implement [`BorrowMut<T>`](trait.borrowmut "BorrowMut<T>"). Further, when providing implementations for additional traits, it needs to be considered whether they should behave identical to those of the underlying type as a consequence of acting as a representation of that underlying type. Generic code typically uses `Borrow<T>` when it relies on the identical behavior of these additional trait implementations. These traits will likely appear as additional trait bounds. In particular `Eq`, `Ord` and `Hash` must be equivalent for borrowed and owned values: `x.borrow() == y.borrow()` should give the same result as `x == y`. If generic code merely needs to work for all types that can provide a reference to related type `T`, it is often better to use [`AsRef<T>`](../convert/trait.asref "AsRef<T>") as more types can safely implement it. Examples -------- As a data collection, [`HashMap<K, V>`](../collections/struct.hashmap) owns both keys and values. If the key’s actual data is wrapped in a managing type of some kind, it should, however, still be possible to search for a value using a reference to the key’s data. For instance, if the key is a string, then it is likely stored with the hash map as a [`String`](../string/struct.string), while it should be possible to search using a [`&str`](../primitive.str "str"). Thus, `insert` needs to operate on a `String` while `get` needs to be able to use a `&str`. Slightly simplified, the relevant parts of `HashMap<K, V>` look like this: ``` use std::borrow::Borrow; use std::hash::Hash; pub struct HashMap<K, V> { // fields omitted } impl<K, V> HashMap<K, V> { pub fn insert(&self, key: K, value: V) -> Option<V> where K: Hash + Eq { // ... } pub fn get<Q>(&self, k: &Q) -> Option<&V> where K: Borrow<Q>, Q: Hash + Eq + ?Sized { // ... } } ``` The entire hash map is generic over a key type `K`. Because these keys are stored with the hash map, this type has to own the key’s data. When inserting a key-value pair, the map is given such a `K` and needs to find the correct hash bucket and check if the key is already present based on that `K`. It therefore requires `K: Hash + Eq`. When searching for a value in the map, however, having to provide a reference to a `K` as the key to search for would require to always create such an owned value. For string keys, this would mean a `String` value needs to be created just for the search for cases where only a `str` is available. Instead, the `get` method is generic over the type of the underlying key data, called `Q` in the method signature above. It states that `K` borrows as a `Q` by requiring that `K: Borrow<Q>`. By additionally requiring `Q: Hash + Eq`, it signals the requirement that `K` and `Q` have implementations of the `Hash` and `Eq` traits that produce identical results. The implementation of `get` relies in particular on identical implementations of `Hash` by determining the key’s hash bucket by calling `Hash::hash` on the `Q` value even though it inserted the key based on the hash value calculated from the `K` value. As a consequence, the hash map breaks if a `K` wrapping a `Q` value produces a different hash than `Q`. For instance, imagine you have a type that wraps a string but compares ASCII letters ignoring their case: ``` pub struct CaseInsensitiveString(String); impl PartialEq for CaseInsensitiveString { fn eq(&self, other: &Self) -> bool { self.0.eq_ignore_ascii_case(&other.0) } } impl Eq for CaseInsensitiveString { } ``` Because two equal values need to produce the same hash value, the implementation of `Hash` needs to ignore ASCII case, too: ``` impl Hash for CaseInsensitiveString { fn hash<H: Hasher>(&self, state: &mut H) { for c in self.0.as_bytes() { c.to_ascii_lowercase().hash(state) } } } ``` Can `CaseInsensitiveString` implement `Borrow<str>`? It certainly can provide a reference to a string slice via its contained owned string. But because its `Hash` implementation differs, it behaves differently from `str` and therefore must not, in fact, implement `Borrow<str>`. If it wants to allow others access to the underlying `str`, it can do that via `AsRef<str>` which doesn’t carry any extra requirements. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/borrow.rs.html#178)#### fn borrow(&self) -> &Borrowed Immutably borrows from an owned value. ##### Examples ``` use std::borrow::Borrow; fn check<T: Borrow<str>>(s: T) { assert_eq!("Hello", s.borrow()); } let s = "Hello".to_string(); check(s); let s = "Hello"; check(s); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/str.rs.html#188)### impl Borrow<str> for String [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#746)1.3.0 · ### impl Borrow<CStr> for CString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1282-1287)### impl Borrow<OsStr> for OsString [source](https://doc.rust-lang.org/src/std/path.rs.html#1728-1733)### impl Borrow<Path> for PathBuf [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#21)### impl<'a, B> Borrow<B> for Cow<'a, B>where B: [ToOwned](trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](trait.toowned "trait std::borrow::ToOwned")>::[Owned](trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): 'a, [source](https://doc.rust-lang.org/src/core/borrow.rs.html#226)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · ### impl<T> Borrow<T> for &Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#234)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · ### impl<T> Borrow<T> for &mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2664)### impl<T> Borrow<T> for Rc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2729)### impl<T> Borrow<T> for Arc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · ### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#769)### impl<T, A> Borrow<[T]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1990)1.1.0 · ### impl<T, A> Borrow<T> for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#173)1.4.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow")) · ### impl<T, const N: usize> Borrow<[T]> for [T; N] rust Trait std::borrow::BorrowMut Trait std::borrow::BorrowMut ============================ ``` pub trait BorrowMut<Borrowed>: Borrow<Borrowed>where    Borrowed: ?Sized,{ fn borrow_mut(&mut self) -> &mut Borrowed; } ``` A trait for mutably borrowing data. As a companion to [`Borrow<T>`](trait.borrow "Borrow<T>") this trait allows a type to borrow as an underlying type by providing a mutable reference. See [`Borrow<T>`](trait.borrow "Borrow<T>") for more information on borrowing as another type. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/borrow.rs.html#204)#### fn borrow\_mut(&mut self) -> &mut Borrowed Mutably borrows from an owned value. ##### Examples ``` use std::borrow::BorrowMut; fn check<T: BorrowMut<[i32]>>(mut v: T) { assert_eq!(&mut [1, 2, 3], v.borrow_mut()); } let v = vec![1, 2, 3]; check(v); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/str.rs.html#196)1.36.0 · ### impl BorrowMut<str> for String [source](https://doc.rust-lang.org/src/core/borrow.rs.html#242)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · ### impl<T> BorrowMut<T> for &mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · ### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/slice.rs.html#776)### impl<T, A> BorrowMut<[T]> for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1997)1.1.0 · ### impl<T, A> BorrowMut<T> for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#181)1.4.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow")) · ### impl<T, const N: usize> BorrowMut<[T]> for [T; N] rust Function std::panic::always_abort Function std::panic::always\_abort ================================== ``` pub fn always_abort() ``` 🔬This is a nightly-only experimental API. (`panic_always_abort` [#84438](https://github.com/rust-lang/rust/issues/84438)) Make all future panics abort directly without running the panic hook or unwinding. There is no way to undo this; the effect lasts until the process exits or execs (or the equivalent). Use after fork -------------- This function is particularly useful for calling after `libc::fork`. After `fork`, in a multithreaded program it is (on many platforms) not safe to call the allocator. It is also generally highly undesirable for an unwind to unwind past the `fork`, because that results in the unwind propagating to code that was only ever expecting to run in the parent. `panic::always_abort()` helps avoid both of these. It directly avoids any further unwinding, and if there is a panic, the abort will occur without allocating provided that the arguments to panic can be formatted without allocating. Examples ``` #![feature(panic_always_abort)] use std::panic; panic::always_abort(); let _ = panic::catch_unwind(|| { panic!("inside the catch"); }); // We will have aborted already, due to the panic. unreachable!(); ``` rust Struct std::panic::Location Struct std::panic::Location =========================== ``` pub struct Location<'a> { /* private fields */ } ``` A struct containing information about the location of a panic. This structure is created by [`PanicInfo::location()`](struct.panicinfo#method.location). Examples -------- ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(location) = panic_info.location() { println!("panic occurred in file '{}' at line {}", location.file(), location.line()); } else { println!("panic occurred but can't get location information..."); } })); panic!("Normal panic"); ``` Comparisons ----------- Comparisons for equality and ordering are made in file, line, then column priority. Files are compared as strings, not `Path`, which could be unexpected. See [`Location::file`](struct.location#method.file "Location::file")’s documentation for more discussion. Implementations --------------- [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#39)### impl<'a> Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#87)1.46.0 (const: [unstable](https://github.com/rust-lang/rust/issues/76156 "Tracking issue for const_caller_location")) · #### pub fn caller() -> &'static Location<'static> Returns the source location of the caller of this function. If that function’s caller is annotated then its call location will be returned, and so on up the stack to the first call within a non-tracked function body. ##### Examples ``` use std::panic::Location; /// Returns the [`Location`] at which it is called. #[track_caller] fn get_caller_location() -> &'static Location<'static> { Location::caller() } /// Returns a [`Location`] from within this function's definition. fn get_just_one_location() -> &'static Location<'static> { get_caller_location() } let fixed_location = get_just_one_location(); assert_eq!(fixed_location.file(), file!()); assert_eq!(fixed_location.line(), 14); assert_eq!(fixed_location.column(), 5); // running the same untracked function in a different location gives us the same result let second_fixed_location = get_just_one_location(); assert_eq!(fixed_location.file(), second_fixed_location.file()); assert_eq!(fixed_location.line(), second_fixed_location.line()); assert_eq!(fixed_location.column(), second_fixed_location.column()); let this_location = get_caller_location(); assert_eq!(this_location.file(), file!()); assert_eq!(this_location.line(), 28); assert_eq!(this_location.column(), 21); // running the tracked function in a different location produces a different value let another_location = get_caller_location(); assert_eq!(this_location.file(), another_location.file()); assert_ne!(this_location.line(), another_location.line()); assert_ne!(this_location.column(), another_location.column()); ``` [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#127)#### pub fn file(&self) -> &str Returns the name of the source file from which the panic originated. ##### `&str`, not `&Path` The returned name refers to a source path on the compiling system, but it isn’t valid to represent this directly as a `&Path`. The compiled code may run on a different system with a different `Path` implementation than the system providing the contents and this library does not currently have a different “host path” type. The most surprising behavior occurs when “the same” file is reachable via multiple paths in the module system (usually using the `#[path = "..."]` attribute or similar), which can cause what appears to be identical code to return differing values from this function. ##### Cross-compilation This value is not suitable for passing to `Path::new` or similar constructors when the host platform and target platform differ. ##### Examples ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(location) = panic_info.location() { println!("panic occurred in file '{}'", location.file()); } else { println!("panic occurred but can't get location information..."); } })); panic!("Normal panic"); ``` [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#151)#### pub fn line(&self) -> u32 Returns the line number from which the panic originated. ##### Examples ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(location) = panic_info.location() { println!("panic occurred at line {}", location.line()); } else { println!("panic occurred but can't get location information..."); } })); panic!("Normal panic"); ``` [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#175)1.25.0 · #### pub fn column(&self) -> u32 Returns the column from which the panic originated. ##### Examples ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(location) = panic_info.location() { println!("panic occurred at column {}", location.column()); } else { println!("panic occurred but can't get location information..."); } })); panic!("Normal panic"); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> Clone for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)#### fn clone(&self) -> Location<'a> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> Debug for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#193)1.26.0 · ### impl Display for Location<'\_> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#194)#### fn fmt(&self, formatter: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> Hash for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> Ord for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)#### fn cmp(&self, other: &Location<'a>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> PartialEq<Location<'a>> for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)#### fn eq(&self, other: &Location<'a>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> PartialOrd<Location<'a>> for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)#### fn partial\_cmp(&self, other: &Location<'a>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> Copy for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> Eq for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> StructuralEq for Location<'a> [source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)### impl<'a> StructuralPartialEq for Location<'a> Auto Trait Implementations -------------------------- ### impl<'a> RefUnwindSafe for Location<'a> ### impl<'a> Send for Location<'a> ### impl<'a> Sync for Location<'a> ### impl<'a> Unpin for Location<'a> ### impl<'a> UnwindSafe for Location<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::panic::set_backtrace_style Function std::panic::set\_backtrace\_style ========================================== ``` pub fn set_backtrace_style(style: BacktraceStyle) ``` 🔬This is a nightly-only experimental API. (`panic_backtrace_config` [#93346](https://github.com/rust-lang/rust/issues/93346)) Configure whether the default panic hook will capture and display a backtrace. The default value for this setting may be set by the `RUST_BACKTRACE` environment variable; see the details in [`get_backtrace_style`](fn.get_backtrace_style "get_backtrace_style"). rust Trait std::panic::UnwindSafe Trait std::panic::UnwindSafe ============================ ``` pub auto trait UnwindSafe { } ``` A marker trait which represents “panic safe” types in Rust. This trait is implemented by default for many types and behaves similarly in terms of inference of implementation to the [`Send`](../marker/trait.send "Send") and [`Sync`](../marker/trait.sync "Sync") traits. The purpose of this trait is to encode what types are safe to cross a [`catch_unwind`](fn.catch_unwind) boundary with no fear of unwind safety. ### What is unwind safety? In Rust a function can “return” early if it either panics or calls a function which transitively panics. This sort of control flow is not always anticipated, and has the possibility of causing subtle bugs through a combination of two critical components: 1. A data structure is in a temporarily invalid state when the thread panics. 2. This broken invariant is then later observed. Typically in Rust, it is difficult to perform step (2) because catching a panic involves either spawning a thread (which in turns makes it difficult to later witness broken invariants) or using the `catch_unwind` function in this module. Additionally, even if an invariant is witnessed, it typically isn’t a problem in Rust because there are no uninitialized values (like in C or C++). It is possible, however, for **logical** invariants to be broken in Rust, which can end up causing behavioral bugs. Another key aspect of unwind safety in Rust is that, in the absence of `unsafe` code, a panic cannot lead to memory unsafety. That was a bit of a whirlwind tour of unwind safety, but for more information about unwind safety and how it applies to Rust, see an [associated RFC](https://github.com/rust-lang/rfcs/blob/master/text/1236-stabilize-catch-panic.md). ### What is `UnwindSafe`? Now that we’ve got an idea of what unwind safety is in Rust, it’s also important to understand what this trait represents. As mentioned above, one way to witness broken invariants is through the `catch_unwind` function in this module as it allows catching a panic and then re-using the environment of the closure. Simply put, a type `T` implements `UnwindSafe` if it cannot easily allow witnessing a broken invariant through the use of `catch_unwind` (catching a panic). This trait is an auto trait, so it is automatically implemented for many types, and it is also structurally composed (e.g., a struct is unwind safe if all of its components are unwind safe). Note, however, that this is not an unsafe trait, so there is not a succinct contract that this trait is providing. Instead it is intended as more of a “speed bump” to alert users of `catch_unwind` that broken invariants may be witnessed and may need to be accounted for. ### Who implements `UnwindSafe`? Types such as `&mut T` and `&RefCell<T>` are examples which are **not** unwind safe. The general idea is that any mutable state which can be shared across `catch_unwind` is not unwind safe by default. This is because it is very easy to witness a broken invariant outside of `catch_unwind` as the data is simply accessed as usual. Types like `&Mutex<T>`, however, are unwind safe because they implement poisoning by default. They still allow witnessing a broken invariant, but they already provide their own “speed bumps” to do so. ### When should `UnwindSafe` be used? It is not intended that most types or functions need to worry about this trait. It is only used as a bound on the `catch_unwind` function and as mentioned above, the lack of `unsafe` means it is mostly an advisory. The [`AssertUnwindSafe`](struct.assertunwindsafe "AssertUnwindSafe") wrapper struct can be used to force this trait to be implemented for any closed over variables passed to `catch_unwind`. Implementors ------------ [source](https://doc.rust-lang.org/src/std/sync/once.rs.html#131)1.59.0 · ### impl UnwindSafe for std::sync::Once [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#197)1.64.0 · ### impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone") + [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), [source](https://doc.rust-lang.org/src/std/panic.rs.html#76-82)1.36.0 · ### impl<K, V, S> UnwindSafe for HashMap<K, V, S>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), V: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), S: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#181)### impl<T> !UnwindSafe for &mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#185)### impl<T> UnwindSafe for \*const Twhere T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#187)### impl<T> UnwindSafe for \*mut Twhere T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#183)### impl<T> UnwindSafe for &Twhere T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#191)1.25.0 · ### impl<T> UnwindSafe for NonNull<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#326)### impl<T> UnwindSafe for Rc<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#246)### impl<T> UnwindSafe for Arc<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#193)### impl<T> UnwindSafe for AssertUnwindSafe<T> [source](https://doc.rust-lang.org/src/std/sync/lazy_lock.rs.html#118)### impl<T, F: UnwindSafe> UnwindSafe for LazyLock<T, F>where [OnceLock](../sync/struct.oncelock "struct std::sync::OnceLock")<T>: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), [source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#343)### impl<T: UnwindSafe> UnwindSafe for OnceLock<T> [source](https://doc.rust-lang.org/src/std/panic.rs.html#65)### impl<T: ?Sized> UnwindSafe for Mutex<T> [source](https://doc.rust-lang.org/src/std/panic.rs.html#67)### impl<T: ?Sized> UnwindSafe for RwLock<T> Auto implementors ----------------- ### impl !UnwindSafe for std::io::Error ### impl !UnwindSafe for Command ### impl UnwindSafe for BacktraceStatus ### impl UnwindSafe for std::cmp::Ordering ### impl UnwindSafe for TryReserveErrorKind ### impl UnwindSafe for Infallible ### impl UnwindSafe for VarError ### impl UnwindSafe for c\_void ### impl UnwindSafe for std::fmt::Alignment ### impl UnwindSafe for ErrorKind ### impl UnwindSafe for SeekFrom ### impl UnwindSafe for IpAddr ### impl UnwindSafe for Ipv6MulticastScope ### impl UnwindSafe for Shutdown ### impl UnwindSafe for std::net::SocketAddr ### impl UnwindSafe for FpCategory ### impl UnwindSafe for IntErrorKind ### impl UnwindSafe for AncillaryError ### impl UnwindSafe for Which ### impl UnwindSafe for SearchStep ### impl UnwindSafe for std::sync::atomic::Ordering ### impl UnwindSafe for RecvTimeoutError ### impl UnwindSafe for TryRecvError ### impl UnwindSafe for BacktraceStyle ### impl UnwindSafe for bool ### impl UnwindSafe for char ### impl UnwindSafe for f32 ### impl UnwindSafe for f64 ### impl UnwindSafe for i8 ### impl UnwindSafe for i16 ### impl UnwindSafe for i32 ### impl UnwindSafe for i64 ### impl UnwindSafe for i128 ### impl UnwindSafe for isize ### impl UnwindSafe for str ### impl UnwindSafe for u8 ### impl UnwindSafe for u16 ### impl UnwindSafe for u32 ### impl UnwindSafe for u64 ### impl UnwindSafe for u128 ### impl UnwindSafe for () ### impl UnwindSafe for usize ### impl UnwindSafe for AllocError ### impl UnwindSafe for Global ### impl UnwindSafe for Layout ### impl UnwindSafe for LayoutError ### impl UnwindSafe for System ### impl UnwindSafe for TypeId ### impl UnwindSafe for TryFromSliceError ### impl UnwindSafe for std::ascii::EscapeDefault ### impl UnwindSafe for Backtrace ### impl UnwindSafe for BacktraceFrame ### impl UnwindSafe for BorrowError ### impl UnwindSafe for BorrowMutError ### impl UnwindSafe for CharTryFromError ### impl UnwindSafe for DecodeUtf16Error ### impl UnwindSafe for std::char::EscapeDebug ### impl UnwindSafe for std::char::EscapeDefault ### impl UnwindSafe for std::char::EscapeUnicode ### impl UnwindSafe for ParseCharError ### impl UnwindSafe for ToLowercase ### impl UnwindSafe for ToUppercase ### impl UnwindSafe for TryFromCharError ### impl UnwindSafe for DefaultHasher ### impl UnwindSafe for RandomState ### impl UnwindSafe for TryReserveError ### impl UnwindSafe for Args ### impl UnwindSafe for ArgsOs ### impl UnwindSafe for JoinPathsError ### impl UnwindSafe for Vars ### impl UnwindSafe for VarsOs ### impl UnwindSafe for CStr ### impl UnwindSafe for CString ### impl UnwindSafe for FromBytesWithNulError ### impl UnwindSafe for FromVecWithNulError ### impl UnwindSafe for IntoStringError ### impl UnwindSafe for NulError ### impl UnwindSafe for OsStr ### impl UnwindSafe for OsString ### impl UnwindSafe for std::fmt::Error ### impl UnwindSafe for DirBuilder ### impl UnwindSafe for DirEntry ### impl UnwindSafe for File ### impl UnwindSafe for FileTimes ### impl UnwindSafe for FileType ### impl UnwindSafe for Metadata ### impl UnwindSafe for OpenOptions ### impl UnwindSafe for Permissions ### impl UnwindSafe for ReadDir ### impl UnwindSafe for SipHasher ### impl UnwindSafe for std::io::Empty ### impl UnwindSafe for std::io::Repeat ### impl UnwindSafe for Sink ### impl UnwindSafe for Stderr ### impl UnwindSafe for Stdin ### impl UnwindSafe for Stdout ### impl UnwindSafe for WriterPanicked ### impl UnwindSafe for PhantomPinned ### impl UnwindSafe for Assume ### impl UnwindSafe for AddrParseError ### impl UnwindSafe for IntoIncoming ### impl UnwindSafe for Ipv4Addr ### impl UnwindSafe for Ipv6Addr ### impl UnwindSafe for SocketAddrV4 ### impl UnwindSafe for SocketAddrV6 ### impl UnwindSafe for TcpListener ### impl UnwindSafe for TcpStream ### impl UnwindSafe for UdpSocket ### impl UnwindSafe for NonZeroI8 ### impl UnwindSafe for NonZeroI16 ### impl UnwindSafe for NonZeroI32 ### impl UnwindSafe for NonZeroI64 ### impl UnwindSafe for NonZeroI128 ### impl UnwindSafe for NonZeroIsize ### impl UnwindSafe for NonZeroU8 ### impl UnwindSafe for NonZeroU16 ### impl UnwindSafe for NonZeroU32 ### impl UnwindSafe for NonZeroU64 ### impl UnwindSafe for NonZeroU128 ### impl UnwindSafe for NonZeroUsize ### impl UnwindSafe for ParseFloatError ### impl UnwindSafe for ParseIntError ### impl UnwindSafe for TryFromIntError ### impl UnwindSafe for RangeFull ### impl UnwindSafe for PidFd ### impl UnwindSafe for stat ### impl UnwindSafe for OwnedFd ### impl UnwindSafe for std::os::unix::net::SocketAddr ### impl UnwindSafe for SocketCred ### impl UnwindSafe for UnixDatagram ### impl UnwindSafe for UnixListener ### impl UnwindSafe for UnixStream ### impl UnwindSafe for UCred ### impl UnwindSafe for HandleOrInvalid ### impl UnwindSafe for HandleOrNull ### impl UnwindSafe for InvalidHandleError ### impl UnwindSafe for NullHandleError ### impl UnwindSafe for OwnedHandle ### impl UnwindSafe for OwnedSocket ### impl UnwindSafe for Path ### impl UnwindSafe for PathBuf ### impl UnwindSafe for StripPrefixError ### impl UnwindSafe for Child ### impl UnwindSafe for ChildStderr ### impl UnwindSafe for ChildStdin ### impl UnwindSafe for ChildStdout ### impl UnwindSafe for ExitCode ### impl UnwindSafe for ExitStatus ### impl UnwindSafe for ExitStatusError ### impl UnwindSafe for Output ### impl UnwindSafe for Stdio ### impl UnwindSafe for ParseBoolError ### impl UnwindSafe for Utf8Error ### impl UnwindSafe for FromUtf8Error ### impl UnwindSafe for FromUtf16Error ### impl UnwindSafe for String ### impl UnwindSafe for AtomicBool ### impl UnwindSafe for AtomicI8 ### impl UnwindSafe for AtomicI16 ### impl UnwindSafe for AtomicI32 ### impl UnwindSafe for AtomicI64 ### impl UnwindSafe for AtomicIsize ### impl UnwindSafe for AtomicU8 ### impl UnwindSafe for AtomicU16 ### impl UnwindSafe for AtomicU32 ### impl UnwindSafe for AtomicU64 ### impl UnwindSafe for AtomicUsize ### impl UnwindSafe for RecvError ### impl UnwindSafe for Barrier ### impl UnwindSafe for BarrierWaitResult ### impl UnwindSafe for Condvar ### impl UnwindSafe for OnceState ### impl UnwindSafe for WaitTimeoutResult ### impl UnwindSafe for RawWaker ### impl UnwindSafe for RawWakerVTable ### impl UnwindSafe for Waker ### impl UnwindSafe for AccessError ### impl UnwindSafe for Builder ### impl UnwindSafe for Thread ### impl UnwindSafe for ThreadId ### impl UnwindSafe for Duration ### impl UnwindSafe for FromFloatSecsError ### impl UnwindSafe for Instant ### impl UnwindSafe for SystemTime ### impl UnwindSafe for SystemTimeError ### impl UnwindSafe for Alignment ### impl UnwindSafe for Argument ### impl UnwindSafe for Count ### impl UnwindSafe for FormatSpec ### impl<'a> !UnwindSafe for Demand<'a> ### impl<'a> !UnwindSafe for Arguments<'a> ### impl<'a> !UnwindSafe for Formatter<'a> ### impl<'a> !UnwindSafe for BorrowedCursor<'a> ### impl<'a> !UnwindSafe for IoSliceMut<'a> ### impl<'a> !UnwindSafe for SocketAncillary<'a> ### impl<'a> !UnwindSafe for PanicInfo<'a> ### impl<'a> UnwindSafe for AncillaryData<'a> ### impl<'a> UnwindSafe for Component<'a> ### impl<'a> UnwindSafe for Prefix<'a> ### impl<'a> UnwindSafe for SplitPaths<'a> ### impl<'a> UnwindSafe for IoSlice<'a> ### impl<'a> UnwindSafe for StderrLock<'a> ### impl<'a> UnwindSafe for StdinLock<'a> ### impl<'a> UnwindSafe for StdoutLock<'a> ### impl<'a> UnwindSafe for std::net::Incoming<'a> ### impl<'a> UnwindSafe for std::os::unix::net::Incoming<'a> ### impl<'a> UnwindSafe for Messages<'a> ### impl<'a> UnwindSafe for ScmCredentials<'a> ### impl<'a> UnwindSafe for ScmRights<'a> ### impl<'a> UnwindSafe for EncodeWide<'a> ### impl<'a> UnwindSafe for Ancestors<'a> ### impl<'a> UnwindSafe for Components<'a> ### impl<'a> UnwindSafe for Display<'a> ### impl<'a> UnwindSafe for std::path::Iter<'a> ### impl<'a> UnwindSafe for PrefixComponent<'a> ### impl<'a> UnwindSafe for CommandArgs<'a> ### impl<'a> UnwindSafe for CommandEnvs<'a> ### impl<'a> UnwindSafe for EscapeAscii<'a> ### impl<'a> UnwindSafe for CharSearcher<'a> ### impl<'a> UnwindSafe for std::str::Bytes<'a> ### impl<'a> UnwindSafe for CharIndices<'a> ### impl<'a> UnwindSafe for Chars<'a> ### impl<'a> UnwindSafe for EncodeUtf16<'a> ### impl<'a> UnwindSafe for std::str::EscapeDebug<'a> ### impl<'a> UnwindSafe for std::str::EscapeDefault<'a> ### impl<'a> UnwindSafe for std::str::EscapeUnicode<'a> ### impl<'a> UnwindSafe for std::str::Lines<'a> ### impl<'a> UnwindSafe for LinesAny<'a> ### impl<'a> UnwindSafe for SplitAsciiWhitespace<'a> ### impl<'a> UnwindSafe for SplitWhitespace<'a> ### impl<'a> UnwindSafe for Utf8Chunk<'a> ### impl<'a> UnwindSafe for Utf8Chunks<'a> ### impl<'a> UnwindSafe for std::string::Drain<'a> ### impl<'a> UnwindSafe for Context<'a> ### impl<'a> UnwindSafe for Location<'a> ### impl<'a, 'b> !UnwindSafe for DebugList<'a, 'b> ### impl<'a, 'b> !UnwindSafe for DebugMap<'a, 'b> ### impl<'a, 'b> !UnwindSafe for DebugSet<'a, 'b> ### impl<'a, 'b> !UnwindSafe for DebugStruct<'a, 'b> ### impl<'a, 'b> !UnwindSafe for DebugTuple<'a, 'b> ### impl<'a, 'b> UnwindSafe for CharSliceSearcher<'a, 'b> ### impl<'a, 'b> UnwindSafe for StrSearcher<'a, 'b> ### impl<'a, 'b, const N: usize> UnwindSafe for CharArrayRefSearcher<'a, 'b, N> ### impl<'a, 'f> !UnwindSafe for VaList<'a, 'f> ### impl<'a, A> !UnwindSafe for std::option::IterMut<'a, A> ### impl<'a, A> UnwindSafe for std::option::Iter<'a, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, B: ?Sized> UnwindSafe for Cow<'a, B>where B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <B as [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned")>::[Owned](../borrow/trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, F> UnwindSafe for CharPredicateSearcher<'a, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, I> !UnwindSafe for ByRefSized<'a, I> ### impl<'a, I, A> UnwindSafe for Splice<'a, I, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K> UnwindSafe for std::collections::hash\_set::Drain<'a, K>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K> UnwindSafe for std::collections::hash\_set::Iter<'a, K>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, F> !UnwindSafe for std::collections::hash\_set::DrainFilter<'a, K, F> ### impl<'a, K, V> !UnwindSafe for std::collections::hash\_map::Entry<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::btree\_map::IterMut<'a, K, V> ### impl<'a, K, V> !UnwindSafe for RangeMut<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::btree\_map::ValuesMut<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::hash\_map::IterMut<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::hash\_map::OccupiedEntry<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::hash\_map::OccupiedError<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::hash\_map::VacantEntry<'a, K, V> ### impl<'a, K, V> !UnwindSafe for std::collections::hash\_map::ValuesMut<'a, K, V> ### impl<'a, K, V> UnwindSafe for std::collections::btree\_map::Iter<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::btree\_map::Keys<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::btree\_map::Range<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::btree\_map::Values<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::hash\_map::Drain<'a, K, V>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::hash\_map::Iter<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::hash\_map::Keys<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> UnwindSafe for std::collections::hash\_map::Values<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, A = Global> !UnwindSafe for std::collections::btree\_map::Entry<'a, K, V, A> ### impl<'a, K, V, A = Global> !UnwindSafe for std::collections::btree\_map::OccupiedEntry<'a, K, V, A> ### impl<'a, K, V, A = Global> !UnwindSafe for std::collections::btree\_map::OccupiedError<'a, K, V, A> ### impl<'a, K, V, A = Global> !UnwindSafe for std::collections::btree\_map::VacantEntry<'a, K, V, A> ### impl<'a, K, V, F> !UnwindSafe for std::collections::hash\_map::DrainFilter<'a, K, V, F> ### impl<'a, K, V, F, A = Global> !UnwindSafe for std::collections::btree\_map::DrainFilter<'a, K, V, F, A> ### impl<'a, K, V, S> !UnwindSafe for RawEntryMut<'a, K, V, S> ### impl<'a, K, V, S> !UnwindSafe for RawEntryBuilderMut<'a, K, V, S> ### impl<'a, K, V, S> !UnwindSafe for RawOccupiedEntryMut<'a, K, V, S> ### impl<'a, K, V, S> !UnwindSafe for RawVacantEntryMut<'a, K, V, S> ### impl<'a, K, V, S> UnwindSafe for RawEntryBuilder<'a, K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> UnwindSafe for MatchIndices<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for Matches<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for RMatchIndices<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for RMatches<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for std::str::RSplit<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for std::str::RSplitN<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for RSplitTerminator<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for std::str::Split<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for std::str::SplitInclusive<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for std::str::SplitN<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, P> UnwindSafe for SplitTerminator<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<'a, T> !UnwindSafe for DrainSorted<'a, T> ### impl<'a, T> !UnwindSafe for PeekMut<'a, T> ### impl<'a, T> !UnwindSafe for CursorMut<'a, T> ### impl<'a, T> !UnwindSafe for std::collections::linked\_list::IterMut<'a, T> ### impl<'a, T> !UnwindSafe for std::collections::vec\_deque::IterMut<'a, T> ### impl<'a, T> !UnwindSafe for std::result::IterMut<'a, T> ### impl<'a, T> !UnwindSafe for ChunksExactMut<'a, T> ### impl<'a, T> !UnwindSafe for ChunksMut<'a, T> ### impl<'a, T> !UnwindSafe for std::slice::IterMut<'a, T> ### impl<'a, T> !UnwindSafe for RChunksExactMut<'a, T> ### impl<'a, T> !UnwindSafe for RChunksMut<'a, T> ### impl<'a, T> !UnwindSafe for std::sync::mpsc::Iter<'a, T> ### impl<'a, T> !UnwindSafe for TryIter<'a, T> ### impl<'a, T> UnwindSafe for std::collections::binary\_heap::Drain<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::binary\_heap::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::btree\_set::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::btree\_set::Range<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::btree\_set::SymmetricDifference<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::btree\_set::Union<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::linked\_list::Cursor<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::linked\_list::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::collections::vec\_deque::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::result::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for Chunks<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for ChunksExact<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for std::slice::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for RChunks<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for RChunksExact<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> UnwindSafe for Windows<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> UnwindSafe for std::collections::btree\_set::Difference<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> UnwindSafe for std::collections::btree\_set::Intersection<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> UnwindSafe for std::collections::vec\_deque::Drain<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> UnwindSafe for std::vec::Drain<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, F> !UnwindSafe for std::collections::linked\_list::DrainFilter<'a, T, F> ### impl<'a, T, F, A = Global> !UnwindSafe for std::collections::btree\_set::DrainFilter<'a, T, F, A> ### impl<'a, T, F, A = Global> !UnwindSafe for std::vec::DrainFilter<'a, T, F, A> ### impl<'a, T, P> !UnwindSafe for GroupByMut<'a, T, P> ### impl<'a, T, P> !UnwindSafe for RSplitMut<'a, T, P> ### impl<'a, T, P> !UnwindSafe for RSplitNMut<'a, T, P> ### impl<'a, T, P> !UnwindSafe for SplitInclusiveMut<'a, T, P> ### impl<'a, T, P> !UnwindSafe for SplitMut<'a, T, P> ### impl<'a, T, P> !UnwindSafe for SplitNMut<'a, T, P> ### impl<'a, T, P> UnwindSafe for GroupBy<'a, T, P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> UnwindSafe for std::slice::RSplit<'a, T, P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> UnwindSafe for std::slice::RSplitN<'a, T, P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> UnwindSafe for std::slice::Split<'a, T, P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> UnwindSafe for std::slice::SplitInclusive<'a, T, P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> UnwindSafe for std::slice::SplitN<'a, T, P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> UnwindSafe for std::collections::hash\_set::Difference<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> UnwindSafe for std::collections::hash\_set::Intersection<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> UnwindSafe for std::collections::hash\_set::SymmetricDifference<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> UnwindSafe for std::collections::hash\_set::Union<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, const N: usize> !UnwindSafe for ArrayChunksMut<'a, T, N> ### impl<'a, T, const N: usize> UnwindSafe for std::slice::ArrayChunks<'a, T, N>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, const N: usize> UnwindSafe for ArrayWindows<'a, T, N>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T: ?Sized> UnwindSafe for MutexGuard<'a, T> ### impl<'a, T: ?Sized> UnwindSafe for RwLockReadGuard<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T: ?Sized> UnwindSafe for RwLockWriteGuard<'a, T> ### impl<'a, const N: usize> UnwindSafe for CharArraySearcher<'a, N> ### impl<'b, T> !UnwindSafe for Ref<'b, T> ### impl<'b, T> !UnwindSafe for RefMut<'b, T> ### impl<'data> !UnwindSafe for BorrowedBuf<'data> ### impl<'f> !UnwindSafe for VaListImpl<'f> ### impl<'fd> UnwindSafe for BorrowedFd<'fd> ### impl<'handle> UnwindSafe for BorrowedHandle<'handle> ### impl<'scope, 'env> !UnwindSafe for Scope<'scope, 'env> ### impl<'scope, T> !UnwindSafe for ScopedJoinHandle<'scope, T> ### impl<'socket> UnwindSafe for BorrowedSocket<'socket> ### impl<A> UnwindSafe for std::iter::Repeat<A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<A> UnwindSafe for std::option::IntoIter<A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<A, B> UnwindSafe for std::iter::Chain<A, B>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), B: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<A, B> UnwindSafe for Zip<A, B>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), B: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<B> UnwindSafe for std::io::Lines<B>where B: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<B> UnwindSafe for std::io::Split<B>where B: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<B, C> UnwindSafe for ControlFlow<B, C>where B: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), C: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Dyn> !UnwindSafe for DynMetadata<Dyn> ### impl<E> UnwindSafe for Report<E>where E: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<F> UnwindSafe for PollFn<F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<F> UnwindSafe for FromFn<F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<F> UnwindSafe for OnceWith<F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<F> UnwindSafe for RepeatWith<F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<H> UnwindSafe for BuildHasherDefault<H> ### impl<I> UnwindSafe for FromIter<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for DecodeUtf16<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Cloned<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Copied<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Cycle<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Enumerate<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Flatten<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <<I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](../iter/trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Fuse<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Intersperse<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Peekable<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for Skip<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for StepBy<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I> UnwindSafe for std::iter::Take<I>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, F> UnwindSafe for FilterMap<I, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, F> UnwindSafe for Inspect<I, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, F> UnwindSafe for Map<I, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, G> UnwindSafe for IntersperseWith<I, G>where G: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, P> UnwindSafe for Filter<I, P>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, P> UnwindSafe for MapWhile<I, P>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, P> UnwindSafe for SkipWhile<I, P>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, P> UnwindSafe for TakeWhile<I, P>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, St, F> UnwindSafe for Scan<I, St, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), St: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, U, F> UnwindSafe for FlatMap<I, U, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <U as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](../iter/trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<I, const N: usize> UnwindSafe for std::iter::ArrayChunks<I, N>where I: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Idx> UnwindSafe for std::ops::Range<Idx>where Idx: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Idx> UnwindSafe for RangeFrom<Idx>where Idx: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Idx> UnwindSafe for RangeInclusive<Idx>where Idx: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Idx> UnwindSafe for RangeTo<Idx>where Idx: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Idx> UnwindSafe for RangeToInclusive<Idx>where Idx: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<K> UnwindSafe for std::collections::hash\_set::IntoIter<K>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V> UnwindSafe for std::collections::hash\_map::IntoIter<K, V>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V> UnwindSafe for std::collections::hash\_map::IntoKeys<K, V>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V> UnwindSafe for std::collections::hash\_map::IntoValues<K, V>where K: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> UnwindSafe for std::collections::btree\_map::IntoIter<K, V, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> UnwindSafe for std::collections::btree\_map::IntoKeys<K, V, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> UnwindSafe for std::collections::btree\_map::IntoValues<K, V, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<P> UnwindSafe for Pin<P>where P: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<R> UnwindSafe for BufReader<R>where R: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<R> UnwindSafe for std::io::Bytes<R>where R: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Ret, T> UnwindSafe for fn (T₁, T₂, …, Tₙ) -> Ret ### impl<T> !UnwindSafe for std::rc::Weak<T> ### impl<T> !UnwindSafe for std::sync::mpsc::IntoIter<T> ### impl<T> !UnwindSafe for Receiver<T> ### impl<T> !UnwindSafe for Sender<T> ### impl<T> !UnwindSafe for JoinHandle<T> ### impl<T> UnwindSafe for Bound<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Option<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for TryLockError<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for TrySendError<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Poll<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for [T]where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for (T₁, T₂, …, Tₙ)where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for OnceCell<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Reverse<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::collections::binary\_heap::IntoIter<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> UnwindSafe for IntoIterSorted<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::collections::linked\_list::IntoIter<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> UnwindSafe for BinaryHeap<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for LinkedList<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> UnwindSafe for Pending<T> ### impl<T> UnwindSafe for std::future::Ready<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::io::Cursor<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::io::Take<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::iter::Empty<T> ### impl<T> UnwindSafe for std::iter::Once<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Rev<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Discriminant<T>where <T as [DiscriminantKind](../marker/trait.discriminantkind "trait std::marker::DiscriminantKind")>::[Discriminant](../marker/trait.discriminantkind#associatedtype.Discriminant "type std::marker::DiscriminantKind::Discriminant"): [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Saturating<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Wrapping<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for Yeet<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::result::IntoIter<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for AtomicPtr<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> UnwindSafe for SendError<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for SyncSender<T> ### impl<T> UnwindSafe for PoisonError<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for std::task::Ready<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T> UnwindSafe for LocalKey<T> ### impl<T> UnwindSafe for MaybeUninit<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, A> UnwindSafe for std::collections::btree\_set::IntoIter<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> UnwindSafe for BTreeSet<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> UnwindSafe for VecDeque<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, A> UnwindSafe for std::collections::vec\_deque::IntoIter<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, A> UnwindSafe for std::vec::IntoIter<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe") + [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> UnwindSafe for Vec<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, E> UnwindSafe for Result<T, E>where E: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, F> UnwindSafe for LazyCell<T, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, F> UnwindSafe for Successors<T, F>where F: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, S> UnwindSafe for HashSet<T, S>where S: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, U> UnwindSafe for std::io::Chain<T, U>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), U: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, const LANES: usize> UnwindSafe for Mask<T, LANES>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, const LANES: usize> UnwindSafe for Simd<T, LANES>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, const N: usize> UnwindSafe for [T; N]where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T, const N: usize> UnwindSafe for std::array::IntoIter<T, N>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for ThinBox<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for Cell<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for RefCell<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for SyncUnsafeCell<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for UnsafeCell<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for PhantomData<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for ManuallyDrop<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for Exclusive<T>where T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<T: ?Sized> UnwindSafe for std::sync::Weak<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized, A> UnwindSafe for Box<T, A>where A: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), T: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<W> !UnwindSafe for IntoInnerError<W> ### impl<W> UnwindSafe for BufWriter<W>where W: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<W> UnwindSafe for LineWriter<W>where W: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<Y, R> UnwindSafe for GeneratorState<Y, R>where R: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), Y: [UnwindSafe](trait.unwindsafe "trait std::panic::UnwindSafe"), ### impl<const LANES: usize> UnwindSafe for LaneCount<LANES>
programming_docs
rust Module std::panic Module std::panic ================= Panic support in the standard library. Structs ------- [AssertUnwindSafe](struct.assertunwindsafe "std::panic::AssertUnwindSafe struct") A simple wrapper around a type to assert that it is unwind safe. [Location](struct.location "std::panic::Location struct") A struct containing information about the location of a panic. [PanicInfo](struct.panicinfo "std::panic::PanicInfo struct") A struct providing information about a panic. Enums ----- [BacktraceStyle](enum.backtracestyle "std::panic::BacktraceStyle enum")Experimental The configuration for whether and how the default panic hook will capture and display the backtrace. Traits ------ [RefUnwindSafe](trait.refunwindsafe "std::panic::RefUnwindSafe trait") A marker trait representing types where a shared reference is considered unwind safe. [UnwindSafe](trait.unwindsafe "std::panic::UnwindSafe trait") A marker trait which represents “panic safe” types in Rust. Functions --------- [always\_abort](fn.always_abort "std::panic::always_abort fn")Experimental Make all future panics abort directly without running the panic hook or unwinding. [get\_backtrace\_style](fn.get_backtrace_style "std::panic::get_backtrace_style fn")Experimental Checks whether the standard library’s panic hook will capture and print a backtrace. [set\_backtrace\_style](fn.set_backtrace_style "std::panic::set_backtrace_style fn")Experimental Configure whether the default panic hook will capture and display a backtrace. [update\_hook](fn.update_hook "std::panic::update_hook fn")Experimental Atomic combination of [`take_hook`](fn.take_hook) and [`set_hook`](fn.set_hook). Use this to replace the panic handler with a new panic handler that does something and then executes the old handler. [catch\_unwind](fn.catch_unwind "std::panic::catch_unwind fn") Invokes a closure, capturing the cause of an unwinding panic if one occurs. [panic\_any](fn.panic_any "std::panic::panic_any fn") Panic the current thread with the given message as the panic payload. [resume\_unwind](fn.resume_unwind "std::panic::resume_unwind fn") Triggers a panic without invoking the panic hook. [set\_hook](fn.set_hook "std::panic::set_hook fn") Registers a custom panic hook, replacing any that was previously registered. [take\_hook](fn.take_hook "std::panic::take_hook fn") Unregisters the current panic hook, returning it. rust Enum std::panic::BacktraceStyle Enum std::panic::BacktraceStyle =============================== ``` #[non_exhaustive] pub enum BacktraceStyle { Short, Full, Off, } ``` 🔬This is a nightly-only experimental API. (`panic_backtrace_config` [#93346](https://github.com/rust-lang/rust/issues/93346)) The configuration for whether and how the default panic hook will capture and display the backtrace. Variants (Non-exhaustive) ------------------------- This enum is marked as non-exhaustiveNon-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.### `Short` 🔬This is a nightly-only experimental API. (`panic_backtrace_config` [#93346](https://github.com/rust-lang/rust/issues/93346)) Prints a terser backtrace which ideally only contains relevant information. ### `Full` 🔬This is a nightly-only experimental API. (`panic_backtrace_config` [#93346](https://github.com/rust-lang/rust/issues/93346)) Prints a backtrace with all possible information. ### `Off` 🔬This is a nightly-only experimental API. (`panic_backtrace_config` [#93346](https://github.com/rust-lang/rust/issues/93346)) Disable collecting and displaying backtraces. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl Clone for BacktraceStyle [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)#### fn clone(&self) -> BacktraceStyle Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl Debug for BacktraceStyle [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl PartialEq<BacktraceStyle> for BacktraceStyle [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)#### fn eq(&self, other: &BacktraceStyle) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl Copy for BacktraceStyle [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl Eq for BacktraceStyle [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl StructuralEq for BacktraceStyle [source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl StructuralPartialEq for BacktraceStyle Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for BacktraceStyle ### impl Send for BacktraceStyle ### impl Sync for BacktraceStyle ### impl Unpin for BacktraceStyle ### impl UnwindSafe for BacktraceStyle Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Function std::panic::update_hook Function std::panic::update\_hook ================================= ``` pub fn update_hook<F>(hook_fn: F)where    F: Fn(&(dyn Fn(&PanicInfo<'_>) + Send + Sync + 'static), &PanicInfo<'_>) + Sync + Send + 'static, ``` 🔬This is a nightly-only experimental API. (`panic_update_hook` [#92649](https://github.com/rust-lang/rust/issues/92649)) Atomic combination of [`take_hook`](fn.take_hook) and [`set_hook`](fn.set_hook). Use this to replace the panic handler with a new panic handler that does something and then executes the old handler. Panics ------ Panics if called from a panicking thread. Examples -------- The following will print the custom message, and then the normal output of panic. ⓘ ``` #![feature(panic_update_hook)] use std::panic; // Equivalent to // let prev = panic::take_hook(); // panic::set_hook(move |info| { // println!("..."); // prev(info); // ); panic::update_hook(move |prev, info| { println!("Print custom message and execute panic handler as usual"); prev(info); }); panic!("Custom and then normal"); ``` rust Struct std::panic::PanicInfo Struct std::panic::PanicInfo ============================ ``` pub struct PanicInfo<'a> { /* private fields */ } ``` A struct providing information about a panic. `PanicInfo` structure is passed to a panic hook set by the [`set_hook`](fn.set_hook) function. Examples -------- ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(s) = panic_info.payload().downcast_ref::<&str>() { println!("panic occurred: {s:?}"); } else { println!("panic occurred"); } })); panic!("Normal panic"); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#37)### impl<'a> PanicInfo<'a> [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#88)#### pub fn payload(&self) -> &(dyn Any + Send + 'static) Returns the payload associated with the panic. This will commonly, but not always, be a `&'static str` or [`String`](../string/struct.string). ##### Examples ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(s) = panic_info.payload().downcast_ref::<&str>() { println!("panic occurred: {s:?}"); } else { println!("panic occurred"); } })); panic!("Normal panic"); ``` [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#97)#### pub fn message(&self) -> Option<&Arguments<'\_>> 🔬This is a nightly-only experimental API. (`panic_info_message` [#66745](https://github.com/rust-lang/rust/issues/66745)) If the `panic!` macro from the `core` crate (not from `std`) was used with a formatting string and some additional arguments, returns that message ready to be used for example with [`fmt::write`](../fmt/fn.write "fmt::write") [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#127)#### pub fn location(&self) -> Option<&Location<'\_>> Returns information about the location from which the panic originated, if available. This method will currently always return [`Some`](../option/enum.option#variant.Some "Some"), but this may change in future versions. ##### Examples ⓘ ``` use std::panic; panic::set_hook(Box::new(|panic_info| { if let Some(location) = panic_info.location() { println!("panic occurred in file '{}' at line {}", location.file(), location.line(), ); } else { println!("panic occurred but can't get location information..."); } })); panic!("Normal panic"); ``` [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#145)#### pub fn can\_unwind(&self) -> bool 🔬This is a nightly-only experimental API. (`panic_can_unwind` [#92988](https://github.com/rust-lang/rust/issues/92988)) Returns whether the panic handler is allowed to unwind the stack from the point where the panic occurred. This is true for most kinds of panics with the exception of panics caused by trying to unwind out of a `Drop` implementation or a function whose ABI does not support unwinding. It is safe for a panic handler to unwind even when this function returns true, however this will simply cause the panic handler to be called again. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#29)### impl<'a> Debug for PanicInfo<'a> [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#29)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#151)1.26.0 · ### impl Display for PanicInfo<'\_> [source](https://doc.rust-lang.org/src/core/panic/panic_info.rs.html#152)#### fn fmt(&self, formatter: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.display#tymethod.fmt) Auto Trait Implementations -------------------------- ### impl<'a> !RefUnwindSafe for PanicInfo<'a> ### impl<'a> !Send for PanicInfo<'a> ### impl<'a> !Sync for PanicInfo<'a> ### impl<'a> Unpin for PanicInfo<'a> ### impl<'a> !UnwindSafe for PanicInfo<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2500)### impl<T> ToString for Twhere T: [Display](../fmt/trait.display "trait std::fmt::Display") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2506)#### default fn to\_string(&self) -> String Converts the given value to a `String`. [Read more](../string/trait.tostring#tymethod.to_string) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Function std::panic::take_hook Function std::panic::take\_hook =============================== ``` pub fn take_hook() -> Box<dyn Fn(&PanicInfo<'_>) + Sync + Send + 'static>ⓘNotable traits for Box<I, A>impl<I, A> Iterator for Box<I, A>where    I: Iterator + ?Sized,    A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A>where    F: Future + Unpin + ?Sized,    A: Allocator + 'static, type Output = <F as Future>::Output;impl<R: Read + ?Sized> Read for Box<R>impl<W: Write + ?Sized> Write for Box<W> ``` Unregisters the current panic hook, returning it. *See also the function [`set_hook`](fn.set_hook).* If no custom hook is registered, the default hook will be returned. Panics ------ Panics if called from a panicking thread. Examples -------- The following will print “Normal panic”: ⓘ ``` use std::panic; panic::set_hook(Box::new(|_| { println!("Custom panic hook"); })); let _ = panic::take_hook(); panic!("Normal panic"); ``` rust Struct std::panic::AssertUnwindSafe Struct std::panic::AssertUnwindSafe =================================== ``` pub struct AssertUnwindSafe<T>(pub T); ``` A simple wrapper around a type to assert that it is unwind safe. When using [`catch_unwind`](fn.catch_unwind) it may be the case that some of the closed over variables are not unwind safe. For example if `&mut T` is captured the compiler will generate a warning indicating that it is not unwind safe. It might not be the case, however, that this is actually a problem due to the specific usage of [`catch_unwind`](fn.catch_unwind) if unwind safety is specifically taken into account. This wrapper struct is useful for a quick and lightweight annotation that a variable is indeed unwind safe. Examples -------- One way to use `AssertUnwindSafe` is to assert that the entire closure itself is unwind safe, bypassing all checks for all variables: ``` use std::panic::{self, AssertUnwindSafe}; let mut variable = 4; // This code will not compile because the closure captures `&mut variable` // which is not considered unwind safe by default. // panic::catch_unwind(|| { // variable += 3; // }); // This, however, will compile due to the `AssertUnwindSafe` wrapper let result = panic::catch_unwind(AssertUnwindSafe(|| { variable += 3; })); // ... ``` Wrapping the entire closure amounts to a blanket assertion that all captured variables are unwind safe. This has the downside that if new captures are added in the future, they will also be considered unwind safe. Therefore, you may prefer to just wrap individual captures, as shown below. This is more annotation, but it ensures that if a new capture is added which is not unwind safe, you will get a compilation error at that time, which will allow you to consider whether that new capture in fact represent a bug or not. ``` use std::panic::{self, AssertUnwindSafe}; let mut variable = 4; let other_capture = 3; let result = { let mut wrapper = AssertUnwindSafe(&mut variable); panic::catch_unwind(move || { **wrapper += other_capture; }) }; // ... ``` Tuple Fields ------------ `0: T`Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#301)### impl<S> AsyncIterator for AssertUnwindSafe<S>where S: [AsyncIterator](../async_iter/trait.asynciterator "trait std::async_iter::AsyncIterator"), #### type Item = <S as AsyncIterator>::Item 🔬This is a nightly-only experimental API. (`async_iterator` [#79024](https://github.com/rust-lang/rust/issues/79024)) The type of items yielded by the async iterator. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#304)#### fn poll\_next( self: Pin<&mut AssertUnwindSafe<S>>, cx: &mut Context<'\_>) -> Poll<Option<<S as AsyncIterator>::Item>> 🔬This is a nightly-only experimental API. (`async_iterator` [#79024](https://github.com/rust-lang/rust/issues/79024)) Attempt to pull out the next value of this async iterator, registering the current task for wakeup if the value is not yet available, and returning `None` if the async iterator is exhausted. [Read more](../async_iter/trait.asynciterator#tymethod.poll_next) [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#309)#### fn size\_hint(&self) -> (usize, Option<usize>) 🔬This is a nightly-only experimental API. (`async_iterator` [#79024](https://github.com/rust-lang/rust/issues/79024)) Returns the bounds on the remaining length of the async iterator. [Read more](../async_iter/trait.asynciterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#276)1.16.0 · ### impl<T> Debug for AssertUnwindSafe<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#277)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#283)1.62.0 · ### impl<T> Default for AssertUnwindSafe<T>where T: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#284)#### fn default() -> AssertUnwindSafe<T> Notable traits for [AssertUnwindSafe](struct.assertunwindsafe "struct std::panic::AssertUnwindSafe")<F> ``` impl<F> Future for AssertUnwindSafe<F>where     F: Future, type Output = <F as Future>::Output; ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#251)### impl<T> Deref for AssertUnwindSafe<T> #### type Target = T The resulting type after dereferencing. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#254)#### fn deref(&self) -> &T Dereferences the value. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#260)### impl<T> DerefMut for AssertUnwindSafe<T> [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#261)#### fn deref\_mut(&mut self) -> &mut T Mutably dereferences the value. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#267)### impl<R, F> FnOnce() for AssertUnwindSafe<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> R, #### type Output = R The returned type after the call operator is used. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#270)#### extern "rust-call" fn call\_once(self, \_args: ()) -> R 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#290)1.36.0 · ### impl<F> Future for AssertUnwindSafe<F>where F: [Future](../future/trait.future "trait std::future::Future"), #### type Output = <F as Future>::Output The type of value produced on completion. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#293)#### fn poll( self: Pin<&mut AssertUnwindSafe<F>>, cx: &mut Context<'\_>) -> Poll<<AssertUnwindSafe<F> as Future>::Output> Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. [Read more](../future/trait.future#tymethod.poll) [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#202)### impl<T> RefUnwindSafe for AssertUnwindSafe<T> [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#193)### impl<T> UnwindSafe for AssertUnwindSafe<T> Auto Trait Implementations -------------------------- ### impl<T> Send for AssertUnwindSafe<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for AssertUnwindSafe<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for AssertUnwindSafe<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/future/into_future.rs.html#132)### impl<F> IntoFuture for Fwhere F: [Future](../future/trait.future "trait std::future::Future"), #### type Output = <F as Future>::Output The output that the future will produce on completion. #### type IntoFuture = F Which kind of future are we turning this into? [source](https://doc.rust-lang.org/src/core/future/into_future.rs.html#136)#### fn into\_future(self) -> <F as IntoFuture>::IntoFuture Creates a future from a value. [Read more](../future/trait.intofuture#tymethod.into_future) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::panic::resume_unwind Function std::panic::resume\_unwind =================================== ``` pub fn resume_unwind(payload: Box<dyn Any + Send>) -> ! ``` Triggers a panic without invoking the panic hook. This is designed to be used in conjunction with [`catch_unwind`](fn.catch_unwind "catch_unwind") to, for example, carry a panic across a layer of C code. Notes ----- Note that panics in Rust are not always implemented via unwinding, but they may be implemented by aborting the process. If this function is called when panics are implemented this way then this function will abort the process, not trigger an unwind. Examples -------- ⓘ ``` use std::panic; let result = panic::catch_unwind(|| { panic!("oh no!"); }); if let Err(err) = result { panic::resume_unwind(err); } ``` rust Function std::panic::panic_any Function std::panic::panic\_any =============================== ``` pub fn panic_any<M: 'static + Any + Send>(msg: M) -> ! ``` Panic the current thread with the given message as the panic payload. The message can be of any (`Any + Send`) type, not just strings. The message is wrapped in a `Box<'static + Any + Send>`, which can be accessed later using [`PanicInfo::payload`](struct.panicinfo#method.payload "PanicInfo::payload"). See the [`panic!`](../macro.panic "panic!") macro for more information about panicking. rust Function std::panic::catch_unwind Function std::panic::catch\_unwind ================================== ``` pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> ``` Invokes a closure, capturing the cause of an unwinding panic if one occurs. This function will return `Ok` with the closure’s result if the closure does not panic, and will return `Err(cause)` if the closure panics. The `cause` returned is the object with which panic was originally invoked. It is currently undefined behavior to unwind from Rust code into foreign code, so this function is particularly useful when Rust is called from another language (normally C). This can run arbitrary Rust code, capturing a panic and allowing a graceful handling of the error. It is **not** recommended to use this function for a general try/catch mechanism. The [`Result`](../thread/type.result "Result") type is more appropriate to use for functions that can fail on a regular basis. Additionally, this function is not guaranteed to catch all panics, see the “Notes” section below. The closure provided is required to adhere to the [`UnwindSafe`](trait.unwindsafe "UnwindSafe") trait to ensure that all captured variables are safe to cross this boundary. The purpose of this bound is to encode the concept of [exception safety](https://github.com/rust-lang/rfcs/blob/master/text/1236-stabilize-catch-panic.md) in the type system. Most usage of this function should not need to worry about this bound as programs are naturally unwind safe without `unsafe` code. If it becomes a problem the [`AssertUnwindSafe`](struct.assertunwindsafe "AssertUnwindSafe") wrapper struct can be used to quickly assert that the usage here is indeed unwind safe. Notes ----- Note that this function **might not catch all panics** in Rust. A panic in Rust is not always implemented via unwinding, but can be implemented by aborting the process as well. This function *only* catches unwinding panics, not those that abort the process. Also note that unwinding into Rust code with a foreign exception (e.g. an exception thrown from C++ code) is undefined behavior. Examples -------- ``` use std::panic; let result = panic::catch_unwind(|| { println!("hello!"); }); assert!(result.is_ok()); let result = panic::catch_unwind(|| { panic!("oh no!"); }); assert!(result.is_err()); ``` rust Function std::panic::get_backtrace_style Function std::panic::get\_backtrace\_style ========================================== ``` pub fn get_backtrace_style() -> Option<BacktraceStyle> ``` 🔬This is a nightly-only experimental API. (`panic_backtrace_config` [#93346](https://github.com/rust-lang/rust/issues/93346)) Checks whether the standard library’s panic hook will capture and print a backtrace. This function will, if a backtrace style has not been set via [`set_backtrace_style`](fn.set_backtrace_style "set_backtrace_style"), read the environment variable `RUST_BACKTRACE` to determine a default value for the backtrace formatting: The first call to `get_backtrace_style` may read the `RUST_BACKTRACE` environment variable if `set_backtrace_style` has not been called to override the default value. After a call to `set_backtrace_style` or `get_backtrace_style`, any changes to `RUST_BACKTRACE` will have no effect. `RUST_BACKTRACE` is read according to these rules: * `0` for `BacktraceStyle::Off` * `full` for `BacktraceStyle::Full` * `1` for `BacktraceStyle::Short` * Other values are currently `BacktraceStyle::Short`, but this may change in the future Returns `None` if backtraces aren’t currently supported. rust Trait std::panic::RefUnwindSafe Trait std::panic::RefUnwindSafe =============================== ``` pub auto trait RefUnwindSafe { } ``` A marker trait representing types where a shared reference is considered unwind safe. This trait is namely not implemented by [`UnsafeCell`](../cell/struct.unsafecell "UnsafeCell"), the root of all interior mutability. This is a “helper marker trait” used to provide impl blocks for the [`UnwindSafe`](trait.unwindsafe "UnwindSafe") trait, for more information see that documentation. Implementors ------------ [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#244)1.14.0 · ### impl RefUnwindSafe for AtomicBool [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#209)1.34.0 · ### impl RefUnwindSafe for AtomicI8 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#212)1.34.0 · ### impl RefUnwindSafe for AtomicI16 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#215)1.34.0 · ### impl RefUnwindSafe for AtomicI32 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#218)1.34.0 · ### impl RefUnwindSafe for AtomicI64 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#206)1.14.0 · ### impl RefUnwindSafe for AtomicIsize [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#228)1.34.0 · ### impl RefUnwindSafe for AtomicU8 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#231)1.34.0 · ### impl RefUnwindSafe for AtomicU16 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#234)1.34.0 · ### impl RefUnwindSafe for AtomicU32 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#237)1.34.0 · ### impl RefUnwindSafe for AtomicU64 [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#225)1.14.0 · ### impl RefUnwindSafe for AtomicUsize [source](https://doc.rust-lang.org/src/std/sync/once.rs.html#134)1.59.0 · ### impl RefUnwindSafe for std::sync::Once [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#200)### impl<T> !RefUnwindSafe for UnsafeCell<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#328)1.58.0 · ### impl<T> RefUnwindSafe for Rc<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#248)1.14.0 · ### impl<T> RefUnwindSafe for AtomicPtr<T> [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#202)### impl<T> RefUnwindSafe for AssertUnwindSafe<T> [source](https://doc.rust-lang.org/src/std/sync/lazy_lock.rs.html#116)### impl<T, F: UnwindSafe> RefUnwindSafe for LazyLock<T, F>where [OnceLock](../sync/struct.oncelock "struct std::sync::OnceLock")<T>: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), [source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#341)### impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for OnceLock<T> [source](https://doc.rust-lang.org/src/std/panic.rs.html#70)1.12.0 · ### impl<T: ?Sized> RefUnwindSafe for Mutex<T> [source](https://doc.rust-lang.org/src/std/panic.rs.html#72)1.12.0 · ### impl<T: ?Sized> RefUnwindSafe for RwLock<T> Auto implementors ----------------- ### impl !RefUnwindSafe for Backtrace ### impl !RefUnwindSafe for std::io::Error ### impl !RefUnwindSafe for Command ### impl !RefUnwindSafe for OnceState ### impl RefUnwindSafe for BacktraceStatus ### impl RefUnwindSafe for std::cmp::Ordering ### impl RefUnwindSafe for TryReserveErrorKind ### impl RefUnwindSafe for Infallible ### impl RefUnwindSafe for VarError ### impl RefUnwindSafe for c\_void ### impl RefUnwindSafe for std::fmt::Alignment ### impl RefUnwindSafe for ErrorKind ### impl RefUnwindSafe for SeekFrom ### impl RefUnwindSafe for IpAddr ### impl RefUnwindSafe for Ipv6MulticastScope ### impl RefUnwindSafe for Shutdown ### impl RefUnwindSafe for std::net::SocketAddr ### impl RefUnwindSafe for FpCategory ### impl RefUnwindSafe for IntErrorKind ### impl RefUnwindSafe for AncillaryError ### impl RefUnwindSafe for Which ### impl RefUnwindSafe for SearchStep ### impl RefUnwindSafe for std::sync::atomic::Ordering ### impl RefUnwindSafe for RecvTimeoutError ### impl RefUnwindSafe for TryRecvError ### impl RefUnwindSafe for BacktraceStyle ### impl RefUnwindSafe for bool ### impl RefUnwindSafe for char ### impl RefUnwindSafe for f32 ### impl RefUnwindSafe for f64 ### impl RefUnwindSafe for i8 ### impl RefUnwindSafe for i16 ### impl RefUnwindSafe for i32 ### impl RefUnwindSafe for i64 ### impl RefUnwindSafe for i128 ### impl RefUnwindSafe for isize ### impl RefUnwindSafe for str ### impl RefUnwindSafe for u8 ### impl RefUnwindSafe for u16 ### impl RefUnwindSafe for u32 ### impl RefUnwindSafe for u64 ### impl RefUnwindSafe for u128 ### impl RefUnwindSafe for () ### impl RefUnwindSafe for usize ### impl RefUnwindSafe for AllocError ### impl RefUnwindSafe for Global ### impl RefUnwindSafe for Layout ### impl RefUnwindSafe for LayoutError ### impl RefUnwindSafe for System ### impl RefUnwindSafe for TypeId ### impl RefUnwindSafe for TryFromSliceError ### impl RefUnwindSafe for std::ascii::EscapeDefault ### impl RefUnwindSafe for BacktraceFrame ### impl RefUnwindSafe for BorrowError ### impl RefUnwindSafe for BorrowMutError ### impl RefUnwindSafe for CharTryFromError ### impl RefUnwindSafe for DecodeUtf16Error ### impl RefUnwindSafe for std::char::EscapeDebug ### impl RefUnwindSafe for std::char::EscapeDefault ### impl RefUnwindSafe for std::char::EscapeUnicode ### impl RefUnwindSafe for ParseCharError ### impl RefUnwindSafe for ToLowercase ### impl RefUnwindSafe for ToUppercase ### impl RefUnwindSafe for TryFromCharError ### impl RefUnwindSafe for DefaultHasher ### impl RefUnwindSafe for RandomState ### impl RefUnwindSafe for TryReserveError ### impl RefUnwindSafe for Args ### impl RefUnwindSafe for ArgsOs ### impl RefUnwindSafe for JoinPathsError ### impl RefUnwindSafe for Vars ### impl RefUnwindSafe for VarsOs ### impl RefUnwindSafe for CStr ### impl RefUnwindSafe for CString ### impl RefUnwindSafe for FromBytesWithNulError ### impl RefUnwindSafe for FromVecWithNulError ### impl RefUnwindSafe for IntoStringError ### impl RefUnwindSafe for NulError ### impl RefUnwindSafe for OsStr ### impl RefUnwindSafe for OsString ### impl RefUnwindSafe for std::fmt::Error ### impl RefUnwindSafe for DirBuilder ### impl RefUnwindSafe for DirEntry ### impl RefUnwindSafe for File ### impl RefUnwindSafe for FileTimes ### impl RefUnwindSafe for FileType ### impl RefUnwindSafe for Metadata ### impl RefUnwindSafe for OpenOptions ### impl RefUnwindSafe for Permissions ### impl RefUnwindSafe for ReadDir ### impl RefUnwindSafe for SipHasher ### impl RefUnwindSafe for std::io::Empty ### impl RefUnwindSafe for std::io::Repeat ### impl RefUnwindSafe for Sink ### impl RefUnwindSafe for Stderr ### impl RefUnwindSafe for Stdin ### impl RefUnwindSafe for Stdout ### impl RefUnwindSafe for WriterPanicked ### impl RefUnwindSafe for PhantomPinned ### impl RefUnwindSafe for Assume ### impl RefUnwindSafe for AddrParseError ### impl RefUnwindSafe for IntoIncoming ### impl RefUnwindSafe for Ipv4Addr ### impl RefUnwindSafe for Ipv6Addr ### impl RefUnwindSafe for SocketAddrV4 ### impl RefUnwindSafe for SocketAddrV6 ### impl RefUnwindSafe for TcpListener ### impl RefUnwindSafe for TcpStream ### impl RefUnwindSafe for UdpSocket ### impl RefUnwindSafe for NonZeroI8 ### impl RefUnwindSafe for NonZeroI16 ### impl RefUnwindSafe for NonZeroI32 ### impl RefUnwindSafe for NonZeroI64 ### impl RefUnwindSafe for NonZeroI128 ### impl RefUnwindSafe for NonZeroIsize ### impl RefUnwindSafe for NonZeroU8 ### impl RefUnwindSafe for NonZeroU16 ### impl RefUnwindSafe for NonZeroU32 ### impl RefUnwindSafe for NonZeroU64 ### impl RefUnwindSafe for NonZeroU128 ### impl RefUnwindSafe for NonZeroUsize ### impl RefUnwindSafe for ParseFloatError ### impl RefUnwindSafe for ParseIntError ### impl RefUnwindSafe for TryFromIntError ### impl RefUnwindSafe for RangeFull ### impl RefUnwindSafe for PidFd ### impl RefUnwindSafe for stat ### impl RefUnwindSafe for OwnedFd ### impl RefUnwindSafe for std::os::unix::net::SocketAddr ### impl RefUnwindSafe for SocketCred ### impl RefUnwindSafe for UnixDatagram ### impl RefUnwindSafe for UnixListener ### impl RefUnwindSafe for UnixStream ### impl RefUnwindSafe for UCred ### impl RefUnwindSafe for HandleOrInvalid ### impl RefUnwindSafe for HandleOrNull ### impl RefUnwindSafe for InvalidHandleError ### impl RefUnwindSafe for NullHandleError ### impl RefUnwindSafe for OwnedHandle ### impl RefUnwindSafe for OwnedSocket ### impl RefUnwindSafe for Path ### impl RefUnwindSafe for PathBuf ### impl RefUnwindSafe for StripPrefixError ### impl RefUnwindSafe for Child ### impl RefUnwindSafe for ChildStderr ### impl RefUnwindSafe for ChildStdin ### impl RefUnwindSafe for ChildStdout ### impl RefUnwindSafe for ExitCode ### impl RefUnwindSafe for ExitStatus ### impl RefUnwindSafe for ExitStatusError ### impl RefUnwindSafe for Output ### impl RefUnwindSafe for Stdio ### impl RefUnwindSafe for ParseBoolError ### impl RefUnwindSafe for Utf8Error ### impl RefUnwindSafe for FromUtf8Error ### impl RefUnwindSafe for FromUtf16Error ### impl RefUnwindSafe for String ### impl RefUnwindSafe for RecvError ### impl RefUnwindSafe for Barrier ### impl RefUnwindSafe for BarrierWaitResult ### impl RefUnwindSafe for Condvar ### impl RefUnwindSafe for WaitTimeoutResult ### impl RefUnwindSafe for RawWaker ### impl RefUnwindSafe for RawWakerVTable ### impl RefUnwindSafe for Waker ### impl RefUnwindSafe for AccessError ### impl RefUnwindSafe for Builder ### impl RefUnwindSafe for Thread ### impl RefUnwindSafe for ThreadId ### impl RefUnwindSafe for Duration ### impl RefUnwindSafe for FromFloatSecsError ### impl RefUnwindSafe for Instant ### impl RefUnwindSafe for SystemTime ### impl RefUnwindSafe for SystemTimeError ### impl RefUnwindSafe for Alignment ### impl RefUnwindSafe for Argument ### impl RefUnwindSafe for Count ### impl RefUnwindSafe for FormatSpec ### impl<'a> !RefUnwindSafe for Demand<'a> ### impl<'a> !RefUnwindSafe for Arguments<'a> ### impl<'a> !RefUnwindSafe for Formatter<'a> ### impl<'a> !RefUnwindSafe for PanicInfo<'a> ### impl<'a> RefUnwindSafe for AncillaryData<'a> ### impl<'a> RefUnwindSafe for Component<'a> ### impl<'a> RefUnwindSafe for Prefix<'a> ### impl<'a> RefUnwindSafe for SplitPaths<'a> ### impl<'a> RefUnwindSafe for BorrowedCursor<'a> ### impl<'a> RefUnwindSafe for IoSlice<'a> ### impl<'a> RefUnwindSafe for IoSliceMut<'a> ### impl<'a> RefUnwindSafe for StderrLock<'a> ### impl<'a> RefUnwindSafe for StdinLock<'a> ### impl<'a> RefUnwindSafe for StdoutLock<'a> ### impl<'a> RefUnwindSafe for std::net::Incoming<'a> ### impl<'a> RefUnwindSafe for std::os::unix::net::Incoming<'a> ### impl<'a> RefUnwindSafe for Messages<'a> ### impl<'a> RefUnwindSafe for ScmCredentials<'a> ### impl<'a> RefUnwindSafe for ScmRights<'a> ### impl<'a> RefUnwindSafe for SocketAncillary<'a> ### impl<'a> RefUnwindSafe for EncodeWide<'a> ### impl<'a> RefUnwindSafe for Ancestors<'a> ### impl<'a> RefUnwindSafe for Components<'a> ### impl<'a> RefUnwindSafe for Display<'a> ### impl<'a> RefUnwindSafe for std::path::Iter<'a> ### impl<'a> RefUnwindSafe for PrefixComponent<'a> ### impl<'a> RefUnwindSafe for CommandArgs<'a> ### impl<'a> RefUnwindSafe for CommandEnvs<'a> ### impl<'a> RefUnwindSafe for EscapeAscii<'a> ### impl<'a> RefUnwindSafe for CharSearcher<'a> ### impl<'a> RefUnwindSafe for std::str::Bytes<'a> ### impl<'a> RefUnwindSafe for CharIndices<'a> ### impl<'a> RefUnwindSafe for Chars<'a> ### impl<'a> RefUnwindSafe for EncodeUtf16<'a> ### impl<'a> RefUnwindSafe for std::str::EscapeDebug<'a> ### impl<'a> RefUnwindSafe for std::str::EscapeDefault<'a> ### impl<'a> RefUnwindSafe for std::str::EscapeUnicode<'a> ### impl<'a> RefUnwindSafe for std::str::Lines<'a> ### impl<'a> RefUnwindSafe for LinesAny<'a> ### impl<'a> RefUnwindSafe for SplitAsciiWhitespace<'a> ### impl<'a> RefUnwindSafe for SplitWhitespace<'a> ### impl<'a> RefUnwindSafe for Utf8Chunk<'a> ### impl<'a> RefUnwindSafe for Utf8Chunks<'a> ### impl<'a> RefUnwindSafe for std::string::Drain<'a> ### impl<'a> RefUnwindSafe for Context<'a> ### impl<'a> RefUnwindSafe for Location<'a> ### impl<'a, 'b> !RefUnwindSafe for DebugList<'a, 'b> ### impl<'a, 'b> !RefUnwindSafe for DebugMap<'a, 'b> ### impl<'a, 'b> !RefUnwindSafe for DebugSet<'a, 'b> ### impl<'a, 'b> !RefUnwindSafe for DebugStruct<'a, 'b> ### impl<'a, 'b> !RefUnwindSafe for DebugTuple<'a, 'b> ### impl<'a, 'b> RefUnwindSafe for CharSliceSearcher<'a, 'b> ### impl<'a, 'b> RefUnwindSafe for StrSearcher<'a, 'b> ### impl<'a, 'b, const N: usize> RefUnwindSafe for CharArrayRefSearcher<'a, 'b, N> ### impl<'a, 'f> RefUnwindSafe for VaList<'a, 'f> ### impl<'a, A> RefUnwindSafe for std::option::Iter<'a, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, A> RefUnwindSafe for std::option::IterMut<'a, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, B: ?Sized> RefUnwindSafe for Cow<'a, B>where B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <B as [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned")>::[Owned](../borrow/trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, F> RefUnwindSafe for CharPredicateSearcher<'a, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, I> RefUnwindSafe for ByRefSized<'a, I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, I, A> RefUnwindSafe for Splice<'a, I, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K> RefUnwindSafe for std::collections::hash\_set::Drain<'a, K>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K> RefUnwindSafe for std::collections::hash\_set::Iter<'a, K>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, F> RefUnwindSafe for std::collections::hash\_set::DrainFilter<'a, K, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::Entry<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::btree\_map::Iter<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::btree\_map::IterMut<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::btree\_map::Keys<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::btree\_map::Range<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for RangeMut<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::btree\_map::Values<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::btree\_map::ValuesMut<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::Drain<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::Iter<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::IterMut<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::Keys<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::OccupiedEntry<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::OccupiedError<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::VacantEntry<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::Values<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V> RefUnwindSafe for std::collections::hash\_map::ValuesMut<'a, K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, A> RefUnwindSafe for std::collections::btree\_map::Entry<'a, K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, A> RefUnwindSafe for std::collections::btree\_map::OccupiedEntry<'a, K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, A> RefUnwindSafe for std::collections::btree\_map::OccupiedError<'a, K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, A> RefUnwindSafe for std::collections::btree\_map::VacantEntry<'a, K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, F> RefUnwindSafe for std::collections::hash\_map::DrainFilter<'a, K, V, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, F, A> RefUnwindSafe for std::collections::btree\_map::DrainFilter<'a, K, V, F, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, S> RefUnwindSafe for RawEntryMut<'a, K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, S> RefUnwindSafe for RawEntryBuilder<'a, K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, S> RefUnwindSafe for RawEntryBuilderMut<'a, K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, S> RefUnwindSafe for RawOccupiedEntryMut<'a, K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, K, V, S> RefUnwindSafe for RawVacantEntryMut<'a, K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for MatchIndices<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for Matches<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for RMatchIndices<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for RMatches<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for std::str::RSplit<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for std::str::RSplitN<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for RSplitTerminator<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for std::str::Split<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for std::str::SplitInclusive<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for std::str::SplitN<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, P> RefUnwindSafe for SplitTerminator<'a, P>where <P as [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>>::[Searcher](../str/pattern/trait.pattern#associatedtype.Searcher "type std::str::pattern::Pattern::Searcher"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> !RefUnwindSafe for std::sync::mpsc::Iter<'a, T> ### impl<'a, T> !RefUnwindSafe for TryIter<'a, T> ### impl<'a, T> RefUnwindSafe for std::collections::binary\_heap::Drain<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for DrainSorted<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::binary\_heap::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for PeekMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::btree\_set::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::btree\_set::Range<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::btree\_set::SymmetricDifference<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::btree\_set::Union<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::linked\_list::Cursor<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for CursorMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::linked\_list::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::linked\_list::IterMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::vec\_deque::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::collections::vec\_deque::IterMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::result::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::result::IterMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for Chunks<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for ChunksExact<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for ChunksExactMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for ChunksMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::slice::Iter<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for std::slice::IterMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for RChunks<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for RChunksExact<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for RChunksExactMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for RChunksMut<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T> RefUnwindSafe for Windows<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> RefUnwindSafe for std::collections::btree\_set::Difference<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> RefUnwindSafe for std::collections::btree\_set::Intersection<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> RefUnwindSafe for std::collections::vec\_deque::Drain<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, A> RefUnwindSafe for std::vec::Drain<'a, T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, F> RefUnwindSafe for std::collections::linked\_list::DrainFilter<'a, T, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, F, A> RefUnwindSafe for std::collections::btree\_set::DrainFilter<'a, T, F, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, F, A> RefUnwindSafe for std::vec::DrainFilter<'a, T, F, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for GroupBy<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for GroupByMut<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for std::slice::RSplit<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for RSplitMut<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for std::slice::RSplitN<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for RSplitNMut<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for std::slice::Split<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for std::slice::SplitInclusive<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for SplitInclusiveMut<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for SplitMut<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for std::slice::SplitN<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, P> RefUnwindSafe for SplitNMut<'a, T, P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> RefUnwindSafe for std::collections::hash\_set::Difference<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> RefUnwindSafe for std::collections::hash\_set::Intersection<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> RefUnwindSafe for std::collections::hash\_set::SymmetricDifference<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, S> RefUnwindSafe for std::collections::hash\_set::Union<'a, T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, const N: usize> RefUnwindSafe for std::slice::ArrayChunks<'a, T, N>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, const N: usize> RefUnwindSafe for ArrayChunksMut<'a, T, N>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T, const N: usize> RefUnwindSafe for ArrayWindows<'a, T, N>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T: ?Sized> RefUnwindSafe for MutexGuard<'a, T> ### impl<'a, T: ?Sized> RefUnwindSafe for RwLockReadGuard<'a, T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<'a, T: ?Sized> RefUnwindSafe for RwLockWriteGuard<'a, T> ### impl<'a, const N: usize> RefUnwindSafe for CharArraySearcher<'a, N> ### impl<'b, T> !RefUnwindSafe for Ref<'b, T> ### impl<'b, T> !RefUnwindSafe for RefMut<'b, T> ### impl<'data> RefUnwindSafe for BorrowedBuf<'data> ### impl<'f> RefUnwindSafe for VaListImpl<'f> ### impl<'fd> RefUnwindSafe for BorrowedFd<'fd> ### impl<'handle> RefUnwindSafe for BorrowedHandle<'handle> ### impl<'scope, 'env> RefUnwindSafe for Scope<'scope, 'env> ### impl<'scope, T> !RefUnwindSafe for ScopedJoinHandle<'scope, T> ### impl<'socket> RefUnwindSafe for BorrowedSocket<'socket> ### impl<A> RefUnwindSafe for std::iter::Repeat<A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<A> RefUnwindSafe for std::option::IntoIter<A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<A, B> RefUnwindSafe for std::iter::Chain<A, B>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<A, B> RefUnwindSafe for Zip<A, B>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<B> RefUnwindSafe for std::io::Lines<B>where B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<B> RefUnwindSafe for std::io::Split<B>where B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<B, C> RefUnwindSafe for ControlFlow<B, C>where B: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), C: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Dyn> !RefUnwindSafe for DynMetadata<Dyn> ### impl<E> RefUnwindSafe for Report<E>where E: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<F> RefUnwindSafe for PollFn<F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<F> RefUnwindSafe for FromFn<F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<F> RefUnwindSafe for OnceWith<F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<F> RefUnwindSafe for RepeatWith<F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<H> RefUnwindSafe for BuildHasherDefault<H> ### impl<I> RefUnwindSafe for FromIter<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for DecodeUtf16<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Cloned<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Copied<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Cycle<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Enumerate<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Flatten<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <<I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](../iter/trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Fuse<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Intersperse<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Peekable<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for Skip<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for StepBy<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I> RefUnwindSafe for std::iter::Take<I>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, F> RefUnwindSafe for FilterMap<I, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, F> RefUnwindSafe for Inspect<I, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, F> RefUnwindSafe for Map<I, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, G> RefUnwindSafe for IntersperseWith<I, G>where G: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, P> RefUnwindSafe for Filter<I, P>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, P> RefUnwindSafe for MapWhile<I, P>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, P> RefUnwindSafe for SkipWhile<I, P>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, P> RefUnwindSafe for TakeWhile<I, P>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, St, F> RefUnwindSafe for Scan<I, St, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), St: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, U, F> RefUnwindSafe for FlatMap<I, U, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <U as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](../iter/trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<I, const N: usize> RefUnwindSafe for std::iter::ArrayChunks<I, N>where I: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), <I as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> RefUnwindSafe for std::ops::Range<Idx>where Idx: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> RefUnwindSafe for RangeFrom<Idx>where Idx: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> RefUnwindSafe for RangeInclusive<Idx>where Idx: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> RefUnwindSafe for RangeTo<Idx>where Idx: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> RefUnwindSafe for RangeToInclusive<Idx>where Idx: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K> RefUnwindSafe for std::collections::hash\_set::IntoIter<K>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V> RefUnwindSafe for std::collections::hash\_map::IntoIter<K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V> RefUnwindSafe for std::collections::hash\_map::IntoKeys<K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V> RefUnwindSafe for std::collections::hash\_map::IntoValues<K, V>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> RefUnwindSafe for std::collections::btree\_map::IntoIter<K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> RefUnwindSafe for std::collections::btree\_map::IntoKeys<K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> RefUnwindSafe for std::collections::btree\_map::IntoValues<K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, A> RefUnwindSafe for BTreeMap<K, V, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<K, V, S> RefUnwindSafe for HashMap<K, V, S>where K: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), V: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<P> RefUnwindSafe for Pin<P>where P: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<R> RefUnwindSafe for BufReader<R>where R: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<R> RefUnwindSafe for std::io::Bytes<R>where R: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Ret, T> RefUnwindSafe for fn (T₁, T₂, …, Tₙ) -> Ret ### impl<T> !RefUnwindSafe for Cell<T> ### impl<T> !RefUnwindSafe for OnceCell<T> ### impl<T> !RefUnwindSafe for RefCell<T> ### impl<T> !RefUnwindSafe for SyncUnsafeCell<T> ### impl<T> !RefUnwindSafe for std::rc::Weak<T> ### impl<T> !RefUnwindSafe for std::sync::mpsc::IntoIter<T> ### impl<T> !RefUnwindSafe for Receiver<T> ### impl<T> !RefUnwindSafe for Sender<T> ### impl<T> !RefUnwindSafe for JoinHandle<T> ### impl<T> RefUnwindSafe for Bound<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Option<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for TryLockError<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for TrySendError<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Poll<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for [T]where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for (T₁, T₂, …, Tₙ)where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Reverse<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::collections::binary\_heap::IntoIter<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for IntoIterSorted<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::collections::linked\_list::IntoIter<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for BinaryHeap<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for LinkedList<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Pending<T> ### impl<T> RefUnwindSafe for std::future::Ready<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::io::Cursor<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::io::Take<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::iter::Empty<T> ### impl<T> RefUnwindSafe for std::iter::Once<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Rev<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Discriminant<T>where <T as [DiscriminantKind](../marker/trait.discriminantkind "trait std::marker::DiscriminantKind")>::[Discriminant](../marker/trait.discriminantkind#associatedtype.Discriminant "type std::marker::DiscriminantKind::Discriminant"): [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Saturating<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Wrapping<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for Yeet<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::result::IntoIter<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for SendError<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for SyncSender<T> ### impl<T> RefUnwindSafe for PoisonError<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for std::task::Ready<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> RefUnwindSafe for LocalKey<T> ### impl<T> RefUnwindSafe for MaybeUninit<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> RefUnwindSafe for std::collections::btree\_set::IntoIter<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> RefUnwindSafe for BTreeSet<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> RefUnwindSafe for VecDeque<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> RefUnwindSafe for std::collections::vec\_deque::IntoIter<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> RefUnwindSafe for std::vec::IntoIter<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, A> RefUnwindSafe for Vec<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, E> RefUnwindSafe for Result<T, E>where E: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, F> RefUnwindSafe for Successors<T, F>where F: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, F = fn() -> T> !RefUnwindSafe for LazyCell<T, F> ### impl<T, S> RefUnwindSafe for HashSet<T, S>where S: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, U> RefUnwindSafe for std::io::Chain<T, U>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), U: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, const LANES: usize> RefUnwindSafe for Mask<T, LANES>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, const LANES: usize> RefUnwindSafe for Simd<T, LANES>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, const N: usize> RefUnwindSafe for [T; N]where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T, const N: usize> RefUnwindSafe for std::array::IntoIter<T, N>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for \*const Twhere T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for \*mut Twhere T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for ThinBox<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for PhantomData<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for ManuallyDrop<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for NonNull<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for Arc<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for Exclusive<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> RefUnwindSafe for std::sync::Weak<T>where T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized, A> RefUnwindSafe for Box<T, A>where A: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<W> !RefUnwindSafe for IntoInnerError<W> ### impl<W> RefUnwindSafe for BufWriter<W>where W: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<W> RefUnwindSafe for LineWriter<W>where W: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Y, R> RefUnwindSafe for GeneratorState<Y, R>where R: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), Y: [RefUnwindSafe](trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<const LANES: usize> RefUnwindSafe for LaneCount<LANES>
programming_docs
rust Function std::panic::set_hook Function std::panic::set\_hook ============================== ``` pub fn set_hook(hook: Box<dyn Fn(&PanicInfo<'_>) + Sync + Send + 'static>) ``` Registers a custom panic hook, replacing any that was previously registered. The panic hook is invoked when a thread panics, but before the panic runtime is invoked. As such, the hook will run with both the aborting and unwinding runtimes. The default hook prints a message to standard error and generates a backtrace if requested, but this behavior can be customized with the `set_hook` and [`take_hook`](fn.take_hook) functions. The hook is provided with a `PanicInfo` struct which contains information about the origin of the panic, including the payload passed to `panic!` and the source code location from which the panic originated. The panic hook is a global resource. Panics ------ Panics if called from a panicking thread. Examples -------- The following will print “Custom panic hook”: ⓘ ``` use std::panic; panic::set_hook(Box::new(|_| { println!("Custom panic hook"); })); panic!("Normal panic"); ``` rust Macro std::ptr::addr_of Macro std::ptr::addr\_of ======================== ``` pub macro addr_of($place:expr) { ... } ``` Create a `const` raw pointer to a place, without creating an intermediate reference. Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned and points to initialized data. For cases where those requirements do not hold, raw pointers should be used instead. However, `&expr as *const _` creates a reference before casting it to a raw pointer, and that reference is subject to the same rules as all other references. This macro can create a raw pointer *without* creating a reference first. Note, however, that the `expr` in `addr_of!(expr)` is still subject to all the usual rules. In particular, `addr_of!(*ptr::null())` is Undefined Behavior because it dereferences a null pointer. Example ------- ``` use std::ptr; #[repr(packed)] struct Packed { f1: u8, f2: u16, } let packed = Packed { f1: 1, f2: 2 }; // `&packed.f2` would create an unaligned reference, and thus be Undefined Behavior! let raw_f2 = ptr::addr_of!(packed.f2); assert_eq!(unsafe { raw_f2.read_unaligned() }, 2); ``` See [`addr_of_mut`](macro.addr_of_mut "addr_of_mut") for how to create a pointer to unininitialized data. Doing that with `addr_of` would not make much sense since one could only read the data, and that would be Undefined Behavior. rust Function std::ptr::from_raw_parts_mut Function std::ptr::from\_raw\_parts\_mut ======================================== ``` pub fn from_raw_parts_mut<T>(    data_address: *mut (),    metadata: <T as Pointee>::Metadata) -> *mut Twhere    T: ?Sized, ``` 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Performs the same functionality as [`from_raw_parts`](fn.from_raw_parts "from_raw_parts"), except that a raw `*mut` pointer is returned, as opposed to a raw `*const` pointer. See the documentation of [`from_raw_parts`](fn.from_raw_parts "from_raw_parts") for more details. rust Function std::ptr::read_volatile Function std::ptr::read\_volatile ================================= ``` pub unsafe fn read_volatile<T>(src: *const T) -> T ``` Performs a volatile read of the value from `src` without moving it. This leaves the memory in `src` unchanged. Volatile operations are intended to act on I/O memory, and are guaranteed to not be elided or reordered by the compiler across other volatile operations. Notes ----- Rust does not currently have a rigorously and formally defined memory model, so the precise semantics of what “volatile” means here is subject to change over time. That being said, the semantics will almost always end up pretty similar to [C11’s definition of volatile](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf). The compiler shouldn’t change the relative order or number of volatile memory operations. However, volatile memory operations on zero-sized types (e.g., if a zero-sized type is passed to `read_volatile`) are noops and may be ignored. Safety ------ Behavior is undefined if any of the following conditions are violated: * `src` must be [valid](index#safety) for reads. * `src` must be properly aligned. * `src` must point to a properly initialized value of type `T`. Like [`read`](fn.read "read"), `read_volatile` creates a bitwise copy of `T`, regardless of whether `T` is [`Copy`](../marker/trait.copy "Copy"). If `T` is not [`Copy`](../marker/trait.copy "Copy"), using both the returned value and the value at `*src` can [violate memory safety](fn.read#ownership-of-the-returned-value). However, storing non-[`Copy`](../marker/trait.copy "Copy") types in volatile memory is almost certainly incorrect. Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. Just like in C, whether an operation is volatile has no bearing whatsoever on questions involving concurrent access from multiple threads. Volatile accesses behave exactly like non-atomic accesses in that regard. In particular, a race between a `read_volatile` and any write operation to the same location is undefined behavior. Examples -------- Basic usage: ``` let x = 12; let y = &x as *const i32; unsafe { assert_eq!(std::ptr::read_volatile(y), 12); } ``` rust Function std::ptr::read Function std::ptr::read ======================= ``` pub unsafe fn read<T>(src: *const T) -> T ``` Reads the value from `src` without moving it. This leaves the memory in `src` unchanged. Safety ------ Behavior is undefined if any of the following conditions are violated: * `src` must be [valid](index#safety) for reads. * `src` must be properly aligned. Use [`read_unaligned`](fn.read_unaligned "read_unaligned") if this is not the case. * `src` must point to a properly initialized value of type `T`. Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. Examples -------- Basic usage: ``` let x = 12; let y = &x as *const i32; unsafe { assert_eq!(std::ptr::read(y), 12); } ``` Manually implement [`mem::swap`](../mem/fn.swap "mem::swap"): ``` use std::ptr; fn swap<T>(a: &mut T, b: &mut T) { unsafe { // Create a bitwise copy of the value at `a` in `tmp`. let tmp = ptr::read(a); // Exiting at this point (either by explicitly returning or by // calling a function which panics) would cause the value in `tmp` to // be dropped while the same value is still referenced by `a`. This // could trigger undefined behavior if `T` is not `Copy`. // Create a bitwise copy of the value at `b` in `a`. // This is safe because mutable references cannot alias. ptr::copy_nonoverlapping(b, a, 1); // As above, exiting here could trigger undefined behavior because // the same value is referenced by `a` and `b`. // Move `tmp` into `b`. ptr::write(b, tmp); // `tmp` has been moved (`write` takes ownership of its second argument), // so nothing is dropped implicitly here. } } let mut foo = "foo".to_owned(); let mut bar = "bar".to_owned(); swap(&mut foo, &mut bar); assert_eq!(foo, "bar"); assert_eq!(bar, "foo"); ``` ### Ownership of the Returned Value `read` creates a bitwise copy of `T`, regardless of whether `T` is [`Copy`](../marker/trait.copy "Copy"). If `T` is not [`Copy`](../marker/trait.copy "Copy"), using both the returned value and the value at `*src` can violate memory safety. Note that assigning to `*src` counts as a use because it will attempt to drop the value at `*src`. [`write()`](fn.write "write()") can be used to overwrite data without causing it to be dropped. ``` use std::ptr; let mut s = String::from("foo"); unsafe { // `s2` now points to the same underlying memory as `s`. let mut s2: String = ptr::read(&s); assert_eq!(s2, "foo"); // Assigning to `s2` causes its original value to be dropped. Beyond // this point, `s` must no longer be used, as the underlying memory has // been freed. s2 = String::default(); assert_eq!(s2, ""); // Assigning to `s` would cause the old value to be dropped again, // resulting in undefined behavior. // s = String::from("bar"); // ERROR // `ptr::write` can be used to overwrite a value without dropping it. ptr::write(&mut s, String::from("bar")); } assert_eq!(s, "bar"); ``` rust Struct std::ptr::DynMetadata Struct std::ptr::DynMetadata ============================ ``` pub struct DynMetadata<Dyn>where    Dyn: ?Sized,{ /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) The metadata for a `Dyn = dyn SomeTrait` trait object type. It is a pointer to a vtable (virtual call table) that represents all the necessary information to manipulate the concrete type stored inside a trait object. The vtable notably it contains: * type size * type alignment * a pointer to the type’s `drop_in_place` impl (may be a no-op for plain-old-data) * pointers to all the methods for the type’s implementation of the trait Note that the first three are special because they’re necessary to allocate, drop, and deallocate any trait object. It is possible to name this struct with a type parameter that is not a `dyn` trait object (for example `DynMetadata<u64>`) but not to obtain a meaningful value of that struct. Implementations --------------- [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#191)### impl<Dyn> DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#194)#### pub fn size\_of(self) -> usize 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Returns the size of the type associated with this vtable. [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#206)#### pub fn align\_of(self) -> usize 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Returns the alignment of the type associated with this vtable. [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#215)#### pub fn layout(self) -> Layout 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Returns the size and alignment together as a `Layout` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#237)### impl<Dyn> Clone for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#239)#### fn clone(&self) -> DynMetadata<Dyn> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#225)### impl<Dyn> Debug for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#226)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#267)### impl<Dyn> Hash for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#269)#### fn hash<H>(&self, hasher: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#253)### impl<Dyn> Ord for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#255)#### fn cmp(&self, other: &DynMetadata<Dyn>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#246)### impl<Dyn> PartialEq<DynMetadata<Dyn>> for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#248)#### fn eq(&self, other: &DynMetadata<Dyn>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#260)### impl<Dyn> PartialOrd<DynMetadata<Dyn>> for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#262)#### fn partial\_cmp(&self, other: &DynMetadata<Dyn>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#235)### impl<Dyn> Copy for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#244)### impl<Dyn> Eq for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#222)### impl<Dyn> Send for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#223)### impl<Dyn> Sync for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#233)### impl<Dyn> Unpin for DynMetadata<Dyn>where Dyn: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<Dyn> !RefUnwindSafe for DynMetadata<Dyn> ### impl<Dyn> !UnwindSafe for DynMetadata<Dyn> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::ptr Module std::ptr =============== Manually manage memory through raw pointers. *[See also the pointer primitive types](../primitive.pointer).* Safety ------ Many functions in this module take raw pointers as arguments and read from or write to them. For this to be safe, these pointers must be *valid*. Whether a pointer is valid depends on the operation it is used for (read or write), and the extent of the memory that is accessed (i.e., how many bytes are read/written). Most functions use `*mut T` and `*const T` to access only a single value, in which case the documentation omits the size and implicitly assumes it to be `size_of::<T>()` bytes. The precise rules for validity are not determined yet. The guarantees that are provided at this point are very minimal: * A [null](fn.null "null") pointer is *never* valid, not even for accesses of [size zero](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts). * For a pointer to be valid, it is necessary, but not always sufficient, that the pointer be *dereferenceable*: the memory range of the given size starting at the pointer must all be within the bounds of a single allocated object. Note that in Rust, every (stack-allocated) variable is considered a separate allocated object. * Even for operations of [size zero](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts), the pointer must not be pointing to deallocated memory, i.e., deallocation makes pointers invalid even for zero-sized operations. However, casting any non-zero integer *literal* to a pointer is valid for zero-sized accesses, even if some memory happens to exist at that address and gets deallocated. This corresponds to writing your own allocator: allocating zero-sized objects is not very hard. The canonical way to obtain a pointer that is valid for zero-sized accesses is [`NonNull::dangling`](struct.nonnull#method.dangling "NonNull::dangling"). * All accesses performed by functions in this module are *non-atomic* in the sense of [atomic operations](../sync/atomic/index) used to synchronize between threads. This means it is undefined behavior to perform two concurrent accesses to the same location from different threads unless both accesses only read from memory. Notice that this explicitly includes [`read_volatile`](fn.read_volatile "read_volatile") and [`write_volatile`](fn.write_volatile "write_volatile"): Volatile accesses cannot be used for inter-thread synchronization. * The result of casting a reference to a pointer is valid for as long as the underlying object is live and no reference (just raw pointers) is used to access the same memory. These axioms, along with careful use of [`offset`](../primitive.pointer#method.offset) for pointer arithmetic, are enough to correctly implement many useful things in unsafe code. Stronger guarantees will be provided eventually, as the [aliasing](https://doc.rust-lang.org/nomicon/aliasing.html) rules are being determined. For more information, see the [book](../../book/ch19-01-unsafe-rust#dereferencing-a-raw-pointer) as well as the section in the reference devoted to [undefined behavior](../../reference/behavior-considered-undefined). ### Alignment Valid raw pointers as defined above are not necessarily properly aligned (where “proper” alignment is defined by the pointee type, i.e., `*const T` must be aligned to `mem::align_of::<T>()`). However, most functions require their arguments to be properly aligned, and will explicitly state this requirement in their documentation. Notable exceptions to this are [`read_unaligned`](fn.read_unaligned "read_unaligned") and [`write_unaligned`](fn.write_unaligned "write_unaligned"). When a function requires proper alignment, it does so even if the access has size 0, i.e., even if memory is not actually touched. Consider using [`NonNull::dangling`](struct.nonnull#method.dangling "NonNull::dangling") in such cases. ### Allocated object For several operations, such as [`offset`](../primitive.pointer#method.offset) or field projections (`expr.field`), the notion of an “allocated object” becomes relevant. An allocated object is a contiguous region of memory. Common examples of allocated objects include stack-allocated variables (each variable is a separate allocated object), heap allocations (each allocation created by the global allocator is a separate allocated object), and `static` variables. Strict Provenance ----------------- **The following text is non-normative, insufficiently formal, and is an extremely strict interpretation of provenance. It’s ok if your code doesn’t strictly conform to it.** [Strict Provenance](https://github.com/rust-lang/rust/issues/95228) is an experimental set of APIs that help tools that try to validate the memory-safety of your program’s execution. Notably this includes [Miri](https://github.com/rust-lang/miri) and [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/), which can detect when you access out of bounds memory or otherwise violate Rust’s memory model. Provenance must exist in some form for any programming language compiled for modern computer architectures, but specifying a model for provenance in a way that is useful to both compilers and programmers is an ongoing challenge. The [Strict Provenance](https://github.com/rust-lang/rust/issues/95228) experiment seeks to explore the question: *what if we just said you couldn’t do all the nasty operations that make provenance so messy?* What APIs would have to be removed? What APIs would have to be added? How much would code have to change, and is it worse or better now? Would any patterns become truly inexpressible? Could we carve out special exceptions for those patterns? Should we? A secondary goal of this project is to see if we can disambiguate the many functions of pointer<->integer casts enough for the definition of `usize` to be loosened so that it isn’t *pointer*-sized but address-space/offset/allocation-sized (we’ll probably continue to conflate these notions). This would potentially make it possible to more efficiently target platforms where pointers are larger than offsets, such as CHERI and maybe some segmented architectures. ### Provenance **This section is *non-normative* and is part of the [Strict Provenance](https://github.com/rust-lang/rust/issues/95228) experiment.** Pointers are not *simply* an “integer” or “address”. For instance, it’s uncontroversial to say that a Use After Free is clearly Undefined Behaviour, even if you “get lucky” and the freed memory gets reallocated before your read/write (in fact this is the worst-case scenario, UAFs would be much less concerning if this didn’t happen!). To rationalize this claim, pointers need to somehow be *more* than just their addresses: they must have provenance. When an allocation is created, that allocation has a unique Original Pointer. For alloc APIs this is literally the pointer the call returns, and for local variables and statics, this is the name of the variable/static. This is mildly overloading the term “pointer” for the sake of brevity/exposition. The Original Pointer for an allocation is guaranteed to have unique access to the entire allocation and *only* that allocation. In this sense, an allocation can be thought of as a “sandbox” that cannot be broken into or out of. *Provenance* is the permission to access an allocation’s sandbox and has both a *spatial* and *temporal* component: * Spatial: A range of bytes that the pointer is allowed to access. * Temporal: The lifetime (of the allocation) that access to these bytes is tied to. Spatial provenance makes sure you don’t go beyond your sandbox, while temporal provenance makes sure that you can’t “get lucky” after your permission to access some memory has been revoked (either through deallocations or borrows expiring). Provenance is implicitly shared with all pointers transitively derived from The Original Pointer through operations like [`offset`](../primitive.pointer#method.offset), borrowing, and pointer casts. Some operations may *shrink* the derived provenance, limiting how much memory it can access or how long it’s valid for (i.e. borrowing a subfield and subslicing). Shrinking provenance cannot be undone: even if you “know” there is a larger allocation, you can’t derive a pointer with a larger provenance. Similarly, you cannot “recombine” two contiguous provenances back into one (i.e. with a `fn merge(&[T], &[T]) -> &[T]`). A reference to a value always has provenance over exactly the memory that field occupies. A reference to a slice always has provenance over exactly the range that slice describes. If an allocation is deallocated, all pointers with provenance to that allocation become invalidated, and effectively lose their provenance. The strict provenance experiment is mostly only interested in exploring stricter *spatial* provenance. In this sense it can be thought of as a subset of the more ambitious and formal [Stacked Borrows](https://plv.mpi-sws.org/rustbelt/stacked-borrows/) research project, which is what tools like [Miri](https://github.com/rust-lang/miri) are based on. In particular, Stacked Borrows is necessary to properly describe what borrows are allowed to do and when they become invalidated. This necessarily involves much more complex *temporal* reasoning than simply identifying allocations. Adjusting APIs and code for the strict provenance experiment will also greatly help Stacked Borrows. ### Pointer Vs Addresses **This section is *non-normative* and is part of the [Strict Provenance](https://github.com/rust-lang/rust/issues/95228) experiment.** One of the largest historical issues with trying to define provenance is that programmers freely convert between pointers and integers. Once you allow for this, it generally becomes impossible to accurately track and preserve provenance information, and you need to appeal to very complex and unreliable heuristics. But of course, converting between pointers and integers is very useful, so what can we do? Also did you know WASM is actually a “Harvard Architecture”? As in function pointers are handled completely differently from data pointers? And we kind of just shipped Rust on WASM without really addressing the fact that we let you freely convert between function pointers and data pointers, because it mostly Just Works? Let’s just put that on the “pointer casts are dubious” pile. Strict Provenance attempts to square these circles by decoupling Rust’s traditional conflation of pointers and `usize` (and `isize`), and defining a pointer to semantically contain the following information: * The **address-space** it is part of (e.g. “data” vs “code” in WASM). * The **address** it points to, which can be represented by a `usize`. * The **provenance** it has, defining the memory it has permission to access. Under Strict Provenance, a usize *cannot* accurately represent a pointer, and converting from a pointer to a usize is generally an operation which *only* extracts the address. It is therefore *impossible* to construct a valid pointer from a usize because there is no way to restore the address-space and provenance. In other words, pointer-integer-pointer roundtrips are not possible (in the sense that the resulting pointer is not dereferenceable). The key insight to making this model *at all* viable is the [`with_addr`](../primitive.pointer#method.with_addr) method: ``` /// Creates a new pointer with the given address. /// /// This performs the same operation as an `addr as ptr` cast, but copies /// the *address-space* and *provenance* of `self` to the new pointer. /// This allows us to dynamically preserve and propagate this important /// information in a way that is otherwise impossible with a unary cast. /// /// This is equivalent to using `wrapping_offset` to offset `self` to the /// given address, and therefore has all the same capabilities and restrictions. pub fn with_addr(self, addr: usize) -> Self; ``` So you’re still able to drop down to the address representation and do whatever clever bit tricks you want *as long as* you’re able to keep around a pointer into the allocation you care about that can “reconstitute” the other parts of the pointer. Usually this is very easy, because you only are taking a pointer, messing with the address, and then immediately converting back to a pointer. To make this use case more ergonomic, we provide the [`map_addr`](../primitive.pointer#method.map_addr) method. To help make it clear that code is “following” Strict Provenance semantics, we also provide an [`addr`](../primitive.pointer#method.addr) method which promises that the returned address is not part of a pointer-usize-pointer roundtrip. In the future we may provide a lint for pointer<->integer casts to help you audit if your code conforms to strict provenance. ### Using Strict Provenance Most code needs no changes to conform to strict provenance, as the only really concerning operation that *wasn’t* obviously already Undefined Behaviour is casts from usize to a pointer. For code which *does* cast a usize to a pointer, the scope of the change depends on exactly what you’re doing. In general you just need to make sure that if you want to convert a usize address to a pointer and then use that pointer to read/write memory, you need to keep around a pointer that has sufficient provenance to perform that read/write itself. In this way all of your casts from an address to a pointer are essentially just applying offsets/indexing. This is generally trivial to do for simple cases like tagged pointers *as long as you represent the tagged pointer as an actual pointer and not a usize*. For instance: ``` #![feature(strict_provenance)] unsafe { // A flag we want to pack into our pointer static HAS_DATA: usize = 0x1; static FLAG_MASK: usize = !HAS_DATA; // Our value, which must have enough alignment to have spare least-significant-bits. let my_precious_data: u32 = 17; assert!(core::mem::align_of::<u32>() > 1); // Create a tagged pointer let ptr = &my_precious_data as *const u32; let tagged = ptr.map_addr(|addr| addr | HAS_DATA); // Check the flag: if tagged.addr() & HAS_DATA != 0 { // Untag and read the pointer let data = *tagged.map_addr(|addr| addr & FLAG_MASK); assert_eq!(data, 17); } else { unreachable!() } } ``` (Yes, if you’ve been using AtomicUsize for pointers in concurrent datastructures, you should be using AtomicPtr instead. If that messes up the way you atomically manipulate pointers, we would like to know why, and what needs to be done to fix it.) Something more complicated and just generally *evil* like an XOR-List requires more significant changes like allocating all nodes in a pre-allocated Vec or Arena and using a pointer to the whole allocation to reconstitute the XORed addresses. Situations where a valid pointer *must* be created from just an address, such as baremetal code accessing a memory-mapped interface at a fixed address, are an open question on how to support. These situations *will* still be allowed, but we might require some kind of “I know what I’m doing” annotation to explain the situation to the compiler. It’s also possible they need no special attention at all, because they’re generally accessing memory outside the scope of “the abstract machine”, or already using “I know what I’m doing” annotations like “volatile”. Under [Strict Provenance](https://github.com/rust-lang/rust/issues/95228) it is Undefined Behaviour to: * Access memory through a pointer that does not have provenance over that memory. * [`offset`](../primitive.pointer#method.offset) a pointer to or from an address it doesn’t have provenance over. This means it’s always UB to offset a pointer derived from something deallocated, even if the offset is 0. Note that a pointer “one past the end” of its provenance is not actually outside its provenance, it just has 0 bytes it can load/store. But it *is* still sound to: * Create an invalid pointer from just an address (see [`ptr::invalid`](fn.invalid)). This can be used for sentinel values like `null` *or* to represent a tagged pointer that will never be dereferenceable. In general, it is always sound for an integer to pretend to be a pointer “for fun” as long as you don’t use operations on it which require it to be valid (offset, read, write, etc). * Forge an allocation of size zero at any sufficiently aligned non-null address. i.e. the usual “ZSTs are fake, do what you want” rules apply *but* this only applies for actual forgery (integers cast to pointers). If you borrow some struct’s field that *happens* to be zero-sized, the resulting pointer will have provenance tied to that allocation and it will still get invalidated if the allocation gets deallocated. In the future we may introduce an API to make such a forged allocation explicit. * [`wrapping_offset`](../primitive.pointer#method.wrapping_offset) a pointer outside its provenance. This includes invalid pointers which have “no” provenance. Unfortunately there may be practical limits on this for a particular platform, and it’s an open question as to how to specify this (if at all). Notably, [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/) relies on a compression scheme that can’t handle a pointer getting offset “too far” out of bounds. If this happens, the address returned by `addr` will be the value you expect, but the provenance will get invalidated and using it to read/write will fault. The details of this are architecture-specific and based on alignment, but the buffer on either side of the pointer’s range is pretty generous (think kilobytes, not bytes). * Compare arbitrary pointers by address. Addresses *are* just integers and so there is always a coherent answer, even if the pointers are invalid or from different address-spaces/provenances. Of course, comparing addresses from different address-spaces is generally going to be *meaningless*, but so is comparing Kilograms to Meters, and Rust doesn’t prevent that either. Similarly, if you get “lucky” and notice that a pointer one-past-the-end is the “same” address as the start of an unrelated allocation, anything you do with that fact is *probably* going to be gibberish. The scope of that gibberish is kept under control by the fact that the two pointers *still* aren’t allowed to access the other’s allocation (bytes), because they still have different provenance. * Perform pointer tagging tricks. This falls out of [`wrapping_offset`](../primitive.pointer#method.wrapping_offset) but is worth mentioning in more detail because of the limitations of [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/). Low-bit tagging is very robust, and often doesn’t even go out of bounds because types ensure size >= align (and over-aligning actually gives CHERI more flexibility). Anything more complex than this rapidly enters “extremely platform-specific” territory as certain things may or may not be allowed based on specific supported operations. For instance, ARM explicitly supports high-bit tagging, and so CHERI on ARM inherits that and should support it. ### Pointer-usize-pointer roundtrips and ‘exposed’ provenance **This section is *non-normative* and is part of the [Strict Provenance](https://github.com/rust-lang/rust/issues/95228) experiment.** As discussed above, pointer-usize-pointer roundtrips are not possible under [Strict Provenance](https://github.com/rust-lang/rust/issues/95228). However, there exists legacy Rust code that is full of such roundtrips, and legacy platform APIs regularly assume that `usize` can capture all the information that makes up a pointer. There also might be code that cannot be ported to Strict Provenance (which is something we would [like to hear about](https://github.com/rust-lang/rust/issues/95228)). For situations like this, there is a fallback plan, a way to ‘opt out’ of Strict Provenance. However, note that this makes your code a lot harder to specify, and the code will not work (well) with tools like [Miri](https://github.com/rust-lang/miri) and [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/). This fallback plan is provided by the [`expose_addr`](../primitive.pointer#method.expose_addr) and [`from_exposed_addr`](fn.from_exposed_addr) methods (which are equivalent to `as` casts between pointers and integers). [`expose_addr`](../primitive.pointer#method.expose_addr) is a lot like [`addr`](../primitive.pointer#method.addr), but additionally adds the provenance of the pointer to a global list of ‘exposed’ provenances. (This list is purely conceptual, it exists for the purpose of specifying Rust but is not materialized in actual executions, except in tools like [Miri](https://github.com/rust-lang/miri).) [`from_exposed_addr`](fn.from_exposed_addr) can be used to construct a pointer with one of these previously ‘exposed’ provenances. [`from_exposed_addr`](fn.from_exposed_addr) takes only `addr: usize` as arguments, so unlike in [`with_addr`](../primitive.pointer#method.with_addr) there is no indication of what the correct provenance for the returned pointer is – and that is exactly what makes pointer-usize-pointer roundtrips so tricky to rigorously specify! There is no algorithm that decides which provenance will be used. You can think of this as “guessing” the right provenance, and the guess will be “maximally in your favor”, in the sense that if there is any way to avoid undefined behavior, then that is the guess that will be taken. However, if there is *no* previously ‘exposed’ provenance that justifies the way the returned pointer will be used, the program has undefined behavior. Using [`expose_addr`](../primitive.pointer#method.expose_addr) or [`from_exposed_addr`](fn.from_exposed_addr) (or the equivalent `as` casts) means that code is *not* following Strict Provenance rules. The goal of the Strict Provenance experiment is to determine whether it is possible to use Rust without [`expose_addr`](../primitive.pointer#method.expose_addr) and [`from_exposed_addr`](fn.from_exposed_addr). If this is successful, it would be a major win for avoiding specification complexity and to facilitate adoption of tools like [CHERI](https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/) and [Miri](https://github.com/rust-lang/miri) that can be a big help in increasing the confidence in (unsafe) Rust code. Macros ------ [addr\_of](macro.addr_of "std::ptr::addr_of macro") Create a `const` raw pointer to a place, without creating an intermediate reference. [addr\_of\_mut](macro.addr_of_mut "std::ptr::addr_of_mut macro") Create a `mut` raw pointer to a place, without creating an intermediate reference. Structs ------- [DynMetadata](struct.dynmetadata "std::ptr::DynMetadata struct")Experimental The metadata for a `Dyn = dyn SomeTrait` trait object type. [NonNull](struct.nonnull "std::ptr::NonNull struct") `*mut T` but non-zero and [covariant](../../reference/subtyping). Traits ------ [Pointee](trait.pointee "std::ptr::Pointee trait")Experimental Provides the pointer metadata type of any pointed-to type. Functions --------- [from\_exposed\_addr](fn.from_exposed_addr "std::ptr::from_exposed_addr fn")Experimental Convert an address back to a pointer, picking up a previously ‘exposed’ provenance. [from\_exposed\_addr\_mut](fn.from_exposed_addr_mut "std::ptr::from_exposed_addr_mut fn")Experimental Convert an address back to a mutable pointer, picking up a previously ‘exposed’ provenance. [from\_raw\_parts](fn.from_raw_parts "std::ptr::from_raw_parts fn")Experimental Forms a (possibly-wide) raw pointer from a data address and metadata. [from\_raw\_parts\_mut](fn.from_raw_parts_mut "std::ptr::from_raw_parts_mut fn")Experimental Performs the same functionality as [`from_raw_parts`](fn.from_raw_parts "from_raw_parts"), except that a raw `*mut` pointer is returned, as opposed to a raw `*const` pointer. [invalid](fn.invalid "std::ptr::invalid fn")Experimental Creates an invalid pointer with the given address. [invalid\_mut](fn.invalid_mut "std::ptr::invalid_mut fn")Experimental Creates an invalid mutable pointer with the given address. [metadata](fn.metadata "std::ptr::metadata fn")Experimental Extract the metadata component of a pointer. [copy](fn.copy "std::ptr::copy fn")[⚠](# "unsafe function") Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source and destination may overlap. [copy\_nonoverlapping](fn.copy_nonoverlapping "std::ptr::copy_nonoverlapping fn")[⚠](# "unsafe function") Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source and destination must *not* overlap. [drop\_in\_place](fn.drop_in_place "std::ptr::drop_in_place fn")[⚠](# "unsafe function") Executes the destructor (if any) of the pointed-to value. [eq](fn.eq "std::ptr::eq fn") Compares raw pointers for equality. [hash](fn.hash "std::ptr::hash fn") Hash a raw pointer. [null](fn.null "std::ptr::null fn") Creates a null raw pointer. [null\_mut](fn.null_mut "std::ptr::null_mut fn") Creates a null mutable raw pointer. [read](fn.read "std::ptr::read fn")[⚠](# "unsafe function") Reads the value from `src` without moving it. This leaves the memory in `src` unchanged. [read\_unaligned](fn.read_unaligned "std::ptr::read_unaligned fn")[⚠](# "unsafe function") Reads the value from `src` without moving it. This leaves the memory in `src` unchanged. [read\_volatile](fn.read_volatile "std::ptr::read_volatile fn")[⚠](# "unsafe function") Performs a volatile read of the value from `src` without moving it. This leaves the memory in `src` unchanged. [replace](fn.replace "std::ptr::replace fn")[⚠](# "unsafe function") Moves `src` into the pointed `dst`, returning the previous `dst` value. [slice\_from\_raw\_parts](fn.slice_from_raw_parts "std::ptr::slice_from_raw_parts fn") Forms a raw slice from a pointer and a length. [slice\_from\_raw\_parts\_mut](fn.slice_from_raw_parts_mut "std::ptr::slice_from_raw_parts_mut fn") Performs the same functionality as [`slice_from_raw_parts`](fn.slice_from_raw_parts "slice_from_raw_parts"), except that a raw mutable slice is returned, as opposed to a raw immutable slice. [swap](fn.swap "std::ptr::swap fn")[⚠](# "unsafe function") Swaps the values at two mutable locations of the same type, without deinitializing either. [swap\_nonoverlapping](fn.swap_nonoverlapping "std::ptr::swap_nonoverlapping fn")[⚠](# "unsafe function") Swaps `count * size_of::<T>()` bytes between the two regions of memory beginning at `x` and `y`. The two regions must *not* overlap. [write](fn.write "std::ptr::write fn")[⚠](# "unsafe function") Overwrites a memory location with the given value without reading or dropping the old value. [write\_bytes](fn.write_bytes "std::ptr::write_bytes fn")[⚠](# "unsafe function") Sets `count * size_of::<T>()` bytes of memory starting at `dst` to `val`. [write\_unaligned](fn.write_unaligned "std::ptr::write_unaligned fn")[⚠](# "unsafe function") Overwrites a memory location with the given value without reading or dropping the old value. [write\_volatile](fn.write_volatile "std::ptr::write_volatile fn")[⚠](# "unsafe function") Performs a volatile write of a memory location with the given value without reading or dropping the old value.
programming_docs
rust Function std::ptr::from_exposed_addr_mut Function std::ptr::from\_exposed\_addr\_mut =========================================== ``` pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T ``` 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Convert an address back to a mutable pointer, picking up a previously ‘exposed’ provenance. This is equivalent to `addr as *mut T`. The provenance of the returned pointer is that of *any* pointer that was previously passed to [`expose_addr`](../primitive.pointer#method.expose_addr "pointer::expose_addr") or a `ptr as usize` cast. If there is no previously ‘exposed’ provenance that justifies the way this pointer will be used, the program has undefined behavior. Note that there is no algorithm that decides which provenance will be used. You can think of this as “guessing” the right provenance, and the guess will be “maximally in your favor”, in the sense that if there is any way to avoid undefined behavior, then that is the guess that will be taken. On platforms with multiple address spaces, it is your responsibility to ensure that the address makes sense in the address space that this pointer will be used with. Using this method means that code is *not* following strict provenance rules. “Guessing” a suitable provenance complicates specification and reasoning and may not be supported by tools that help you to stay conformant with the Rust memory model, so it is recommended to use [`with_addr`](../primitive.pointer#method.with_addr "pointer::with_addr") wherever possible. On most platforms this will produce a value with the same bytes as the address. Platforms which need to store additional information in a pointer may not support this operation, since it is generally not possible to actually *compute* which provenance the returned pointer has to pick up. This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](index "crate::ptr") for details. rust Function std::ptr::drop_in_place Function std::ptr::drop\_in\_place ================================== ``` pub unsafe fn drop_in_place<T>(to_drop: *mut T)where    T: ?Sized, ``` Executes the destructor (if any) of the pointed-to value. This is semantically equivalent to calling [`ptr::read`](fn.read) and discarding the result, but has the following advantages: * It is *required* to use `drop_in_place` to drop unsized types like trait objects, because they can’t be read out onto the stack and dropped normally. * It is friendlier to the optimizer to do this over [`ptr::read`](fn.read) when dropping manually allocated memory (e.g., in the implementations of `Box`/`Rc`/`Vec`), as the compiler doesn’t need to prove that it’s sound to elide the copy. * It can be used to drop [pinned](../pin/index) data when `T` is not `repr(packed)` (pinned data must not be moved before it is dropped). Unaligned values cannot be dropped in place, they must be copied to an aligned location first using [`ptr::read_unaligned`](fn.read_unaligned). For packed structs, this move is done automatically by the compiler. This means the fields of packed structs are not dropped in-place. Safety ------ Behavior is undefined if any of the following conditions are violated: * `to_drop` must be [valid](index#safety) for both reads and writes. * `to_drop` must be properly aligned. * The value `to_drop` points to must be valid for dropping, which may mean it must uphold additional invariants - this is type-dependent. Additionally, if `T` is not [`Copy`](../marker/trait.copy "Copy"), using the pointed-to value after calling `drop_in_place` can cause undefined behavior. Note that `*to_drop = foo` counts as a use because it will cause the value to be dropped again. [`write()`](fn.write "write()") can be used to overwrite data without causing it to be dropped. Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. Examples -------- Manually remove the last item from a vector: ``` use std::ptr; use std::rc::Rc; let last = Rc::new(1); let weak = Rc::downgrade(&last); let mut v = vec![Rc::new(0), last]; unsafe { // Get a raw pointer to the last element in `v`. let ptr = &mut v[1] as *mut _; // Shorten `v` to prevent the last item from being dropped. We do that first, // to prevent issues if the `drop_in_place` below panics. v.set_len(1); // Without a call `drop_in_place`, the last item would never be dropped, // and the memory it manages would be leaked. ptr::drop_in_place(ptr); } assert_eq!(v, &[0.into()]); // Ensure that the last item was dropped. assert!(weak.upgrade().is_none()); ``` rust Function std::ptr::eq Function std::ptr::eq ===================== ``` pub fn eq<T>(a: *const T, b: *const T) -> boolwhere    T: ?Sized, ``` Compares raw pointers for equality. This is the same as using the `==` operator, but less generic: the arguments have to be `*const T` raw pointers, not anything that implements `PartialEq`. This can be used to compare `&T` references (which coerce to `*const T` implicitly) by their address rather than comparing the values they point to (which is what the `PartialEq for &T` implementation does). Examples -------- ``` use std::ptr; let five = 5; let other_five = 5; let five_ref = &five; let same_five_ref = &five; let other_five_ref = &other_five; assert!(five_ref == same_five_ref); assert!(ptr::eq(five_ref, same_five_ref)); assert!(five_ref == other_five_ref); assert!(!ptr::eq(five_ref, other_five_ref)); ``` Slices are also compared by their length (fat pointers): ``` let a = [1, 2, 3]; assert!(std::ptr::eq(&a[..3], &a[..3])); assert!(!std::ptr::eq(&a[..2], &a[..3])); assert!(!std::ptr::eq(&a[0..2], &a[1..3])); ``` Traits are also compared by their implementation: ``` #[repr(transparent)] struct Wrapper { member: i32 } trait Trait {} impl Trait for Wrapper {} impl Trait for i32 {} let wrapper = Wrapper { member: 10 }; // Pointers have equal addresses. assert!(std::ptr::eq( &wrapper as *const Wrapper as *const u8, &wrapper.member as *const i32 as *const u8 )); // Objects have equal addresses, but `Trait` has different implementations. assert!(!std::ptr::eq( &wrapper as &dyn Trait, &wrapper.member as &dyn Trait, )); assert!(!std::ptr::eq( &wrapper as &dyn Trait as *const dyn Trait, &wrapper.member as &dyn Trait as *const dyn Trait, )); // Converting the reference to a `*const u8` compares by address. assert!(std::ptr::eq( &wrapper as &dyn Trait as *const dyn Trait as *const u8, &wrapper.member as &dyn Trait as *const dyn Trait as *const u8, )); ``` rust Function std::ptr::write_unaligned Function std::ptr::write\_unaligned =================================== ``` pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) ``` Overwrites a memory location with the given value without reading or dropping the old value. Unlike [`write()`](fn.write "write()"), the pointer may be unaligned. `write_unaligned` does not drop the contents of `dst`. This is safe, but it could leak allocations or resources, so care should be taken not to overwrite an object that should be dropped. Additionally, it does not drop `src`. Semantically, `src` is moved into the location pointed to by `dst`. This is appropriate for initializing uninitialized memory, or overwriting memory that has previously been read with [`read_unaligned`](fn.read_unaligned "read_unaligned"). Safety ------ Behavior is undefined if any of the following conditions are violated: * `dst` must be [valid](index#safety) for writes. Note that even if `T` has size `0`, the pointer must be non-null. ### On `packed` structs Attempting to create a raw pointer to an `unaligned` struct field with an expression such as `&packed.unaligned as *const FieldType` creates an intermediate unaligned reference before converting that to a raw pointer. That this reference is temporary and immediately cast is inconsequential as the compiler always expects references to be properly aligned. As a result, using `&packed.unaligned as *const FieldType` causes immediate *undefined behavior* in your program. Instead you must use the [`ptr::addr_of_mut!`](macro.addr_of_mut) macro to create the pointer. You may use that returned pointer together with this function. An example of how to do it and how this relates to `write_unaligned` is: ``` #[repr(packed, C)] struct Packed { _padding: u8, unaligned: u32, } let mut packed: Packed = unsafe { std::mem::zeroed() }; // Take the address of a 32-bit integer which is not aligned. // In contrast to `&packed.unaligned as *mut _`, this has no undefined behavior. let unaligned = std::ptr::addr_of_mut!(packed.unaligned); unsafe { std::ptr::write_unaligned(unaligned, 42) }; assert_eq!({packed.unaligned}, 42); // `{...}` forces copying the field instead of creating a reference. ``` Accessing unaligned fields directly with e.g. `packed.unaligned` is safe however (as can be seen in the `assert_eq!` above). Examples -------- Write a usize value to a byte buffer: ``` use std::mem; fn write_usize(x: &mut [u8], val: usize) { assert!(x.len() >= mem::size_of::<usize>()); let ptr = x.as_mut_ptr() as *mut usize; unsafe { ptr.write_unaligned(val) } } ``` rust Function std::ptr::null_mut Function std::ptr::null\_mut ============================ ``` pub const fn null_mut<T>() -> *mut Twhere    T: Thin + ?Sized, ``` Creates a null mutable raw pointer. Examples -------- ``` use std::ptr; let p: *mut i32 = ptr::null_mut(); assert!(p.is_null()); ``` rust Function std::ptr::null Function std::ptr::null ======================= ``` pub const fn null<T>() -> *const Twhere    T: Thin + ?Sized, ``` Creates a null raw pointer. Examples -------- ``` use std::ptr; let p: *const i32 = ptr::null(); assert!(p.is_null()); ``` rust Function std::ptr::hash Function std::ptr::hash ======================= ``` pub fn hash<T, S>(hashee: *const T, into: &mut S)where    S: Hasher,    T: ?Sized, ``` Hash a raw pointer. This can be used to hash a `&T` reference (which coerces to `*const T` implicitly) by its address rather than the value it points to (which is what the `Hash for &T` implementation does). Examples -------- ``` use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; use std::ptr; let five = 5; let five_ref = &five; let mut hasher = DefaultHasher::new(); ptr::hash(five_ref, &mut hasher); let actual = hasher.finish(); let mut hasher = DefaultHasher::new(); (five_ref as *const i32).hash(&mut hasher); let expected = hasher.finish(); assert_eq!(actual, expected); ``` rust Function std::ptr::swap Function std::ptr::swap ======================= ``` pub unsafe fn swap<T>(x: *mut T, y: *mut T) ``` Swaps the values at two mutable locations of the same type, without deinitializing either. But for the following exceptions, this function is semantically equivalent to [`mem::swap`](../mem/fn.swap "mem::swap"): * It operates on raw pointers instead of references. When references are available, [`mem::swap`](../mem/fn.swap "mem::swap") should be preferred. * The two pointed-to values may overlap. If the values do overlap, then the overlapping region of memory from `x` will be used. This is demonstrated in the second example below. * The operation is “untyped” in the sense that data may be uninitialized or otherwise violate the requirements of `T`. The initialization state is preserved exactly. Safety ------ Behavior is undefined if any of the following conditions are violated: * Both `x` and `y` must be [valid](index#safety) for both reads and writes. * Both `x` and `y` must be properly aligned. Note that even if `T` has size `0`, the pointers must be non-null and properly aligned. Examples -------- Swapping two non-overlapping regions: ``` use std::ptr; let mut array = [0, 1, 2, 3]; let (x, y) = array.split_at_mut(2); let x = x.as_mut_ptr().cast::<[u32; 2]>(); // this is `array[0..2]` let y = y.as_mut_ptr().cast::<[u32; 2]>(); // this is `array[2..4]` unsafe { ptr::swap(x, y); assert_eq!([2, 3, 0, 1], array); } ``` Swapping two overlapping regions: ``` use std::ptr; let mut array: [i32; 4] = [0, 1, 2, 3]; let array_ptr: *mut i32 = array.as_mut_ptr(); let x = array_ptr as *mut [i32; 3]; // this is `array[0..3]` let y = unsafe { array_ptr.add(1) } as *mut [i32; 3]; // this is `array[1..4]` unsafe { ptr::swap(x, y); // The indices `1..3` of the slice overlap between `x` and `y`. // Reasonable results would be for to them be `[2, 3]`, so that indices `0..3` are // `[1, 2, 3]` (matching `y` before the `swap`); or for them to be `[0, 1]` // so that indices `1..4` are `[0, 1, 2]` (matching `x` before the `swap`). // This implementation is defined to make the latter choice. assert_eq!([1, 0, 1, 2], array); } ``` rust Function std::ptr::slice_from_raw_parts_mut Function std::ptr::slice\_from\_raw\_parts\_mut =============================================== ``` pub fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] ``` Performs the same functionality as [`slice_from_raw_parts`](fn.slice_from_raw_parts "slice_from_raw_parts"), except that a raw mutable slice is returned, as opposed to a raw immutable slice. See the documentation of [`slice_from_raw_parts`](fn.slice_from_raw_parts "slice_from_raw_parts") for more details. This function is safe, but actually using the return value is unsafe. See the documentation of [`slice::from_raw_parts_mut`](../slice/fn.from_raw_parts_mut) for slice safety requirements. Examples -------- ``` use std::ptr; let x = &mut [5, 6, 7]; let raw_pointer = x.as_mut_ptr(); let slice = ptr::slice_from_raw_parts_mut(raw_pointer, 3); unsafe { (*slice)[2] = 99; // assign a value at an index in the slice }; assert_eq!(unsafe { &*slice }[2], 99); ``` rust Macro std::ptr::addr_of_mut Macro std::ptr::addr\_of\_mut ============================= ``` pub macro addr_of_mut($place:expr) { ... } ``` Create a `mut` raw pointer to a place, without creating an intermediate reference. Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned and points to initialized data. For cases where those requirements do not hold, raw pointers should be used instead. However, `&mut expr as *mut _` creates a reference before casting it to a raw pointer, and that reference is subject to the same rules as all other references. This macro can create a raw pointer *without* creating a reference first. Note, however, that the `expr` in `addr_of_mut!(expr)` is still subject to all the usual rules. In particular, `addr_of_mut!(*ptr::null_mut())` is Undefined Behavior because it dereferences a null pointer. Examples -------- **Creating a pointer to unaligned data:** ``` use std::ptr; #[repr(packed)] struct Packed { f1: u8, f2: u16, } let mut packed = Packed { f1: 1, f2: 2 }; // `&mut packed.f2` would create an unaligned reference, and thus be Undefined Behavior! let raw_f2 = ptr::addr_of_mut!(packed.f2); unsafe { raw_f2.write_unaligned(42); } assert_eq!({packed.f2}, 42); // `{...}` forces copying the field instead of creating a reference. ``` **Creating a pointer to uninitialized data:** ``` use std::{ptr, mem::MaybeUninit}; struct Demo { field: bool, } let mut uninit = MaybeUninit::<Demo>::uninit(); // `&uninit.as_mut().field` would create a reference to an uninitialized `bool`, // and thus be Undefined Behavior! let f1_ptr = unsafe { ptr::addr_of_mut!((*uninit.as_mut_ptr()).field) }; unsafe { f1_ptr.write(true); } let init = unsafe { uninit.assume_init() }; ``` rust Function std::ptr::write_volatile Function std::ptr::write\_volatile ================================== ``` pub unsafe fn write_volatile<T>(dst: *mut T, src: T) ``` Performs a volatile write of a memory location with the given value without reading or dropping the old value. Volatile operations are intended to act on I/O memory, and are guaranteed to not be elided or reordered by the compiler across other volatile operations. `write_volatile` does not drop the contents of `dst`. This is safe, but it could leak allocations or resources, so care should be taken not to overwrite an object that should be dropped. Additionally, it does not drop `src`. Semantically, `src` is moved into the location pointed to by `dst`. Notes ----- Rust does not currently have a rigorously and formally defined memory model, so the precise semantics of what “volatile” means here is subject to change over time. That being said, the semantics will almost always end up pretty similar to [C11’s definition of volatile](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf). The compiler shouldn’t change the relative order or number of volatile memory operations. However, volatile memory operations on zero-sized types (e.g., if a zero-sized type is passed to `write_volatile`) are noops and may be ignored. Safety ------ Behavior is undefined if any of the following conditions are violated: * `dst` must be [valid](index#safety) for writes. * `dst` must be properly aligned. Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. Just like in C, whether an operation is volatile has no bearing whatsoever on questions involving concurrent access from multiple threads. Volatile accesses behave exactly like non-atomic accesses in that regard. In particular, a race between a `write_volatile` and any other operation (reading or writing) on the same location is undefined behavior. Examples -------- Basic usage: ``` let mut x = 0; let y = &mut x as *mut i32; let z = 12; unsafe { std::ptr::write_volatile(y, z); assert_eq!(std::ptr::read_volatile(y), 12); } ``` rust Function std::ptr::invalid Function std::ptr::invalid ========================== ``` pub const fn invalid<T>(addr: usize) -> *const T ``` 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Creates an invalid pointer with the given address. This is different from `addr as *const T`, which creates a pointer that picks up a previously exposed provenance. See [`from_exposed_addr`](fn.from_exposed_addr "from_exposed_addr") for more details on that operation. The module’s top-level documentation discusses the precise meaning of an “invalid” pointer but essentially this expresses that the pointer is not associated with any actual allocation and is little more than a usize address in disguise. This pointer will have no provenance associated with it and is therefore UB to read/write/offset. This mostly exists to facilitate things like `ptr::null` and `NonNull::dangling` which make invalid pointers. (Standard “Zero-Sized-Types get to cheat and lie” caveats apply, although it may be desirable to give them their own API just to make that 100% clear.) This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](index "crate::ptr") for details. rust Function std::ptr::metadata Function std::ptr::metadata =========================== ``` pub fn metadata<T>(ptr: *const T) -> <T as Pointee>::Metadatawhere    T: ?Sized, ``` 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Extract the metadata component of a pointer. Values of type `*mut T`, `&T`, or `&mut T` can be passed directly to this function as they implicitly coerce to `*const T`. Example ------- ``` #![feature(ptr_metadata)] assert_eq!(std::ptr::metadata("foo"), 3_usize); ``` rust Function std::ptr::write Function std::ptr::write ======================== ``` pub unsafe fn write<T>(dst: *mut T, src: T) ``` Overwrites a memory location with the given value without reading or dropping the old value. `write` does not drop the contents of `dst`. This is safe, but it could leak allocations or resources, so care should be taken not to overwrite an object that should be dropped. Additionally, it does not drop `src`. Semantically, `src` is moved into the location pointed to by `dst`. This is appropriate for initializing uninitialized memory, or overwriting memory that has previously been [`read`](fn.read "read") from. Safety ------ Behavior is undefined if any of the following conditions are violated: * `dst` must be [valid](index#safety) for writes. * `dst` must be properly aligned. Use [`write_unaligned`](fn.write_unaligned "write_unaligned") if this is not the case. Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. Examples -------- Basic usage: ``` let mut x = 0; let y = &mut x as *mut i32; let z = 12; unsafe { std::ptr::write(y, z); assert_eq!(std::ptr::read(y), 12); } ``` Manually implement [`mem::swap`](../mem/fn.swap "mem::swap"): ``` use std::ptr; fn swap<T>(a: &mut T, b: &mut T) { unsafe { // Create a bitwise copy of the value at `a` in `tmp`. let tmp = ptr::read(a); // Exiting at this point (either by explicitly returning or by // calling a function which panics) would cause the value in `tmp` to // be dropped while the same value is still referenced by `a`. This // could trigger undefined behavior if `T` is not `Copy`. // Create a bitwise copy of the value at `b` in `a`. // This is safe because mutable references cannot alias. ptr::copy_nonoverlapping(b, a, 1); // As above, exiting here could trigger undefined behavior because // the same value is referenced by `a` and `b`. // Move `tmp` into `b`. ptr::write(b, tmp); // `tmp` has been moved (`write` takes ownership of its second argument), // so nothing is dropped implicitly here. } } let mut foo = "foo".to_owned(); let mut bar = "bar".to_owned(); swap(&mut foo, &mut bar); assert_eq!(foo, "bar"); assert_eq!(bar, "foo"); ```
programming_docs
rust Function std::ptr::copy_nonoverlapping Function std::ptr::copy\_nonoverlapping ======================================= ``` pub const unsafe fn copy_nonoverlapping<T>(    src: *const T,    dst: *mut T,    count: usize) ``` Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source and destination must *not* overlap. For regions of memory which might overlap, use [`copy`](fn.copy "copy") instead. `copy_nonoverlapping` is semantically equivalent to C’s [`memcpy`](https://en.cppreference.com/w/c/string/byte/memcpy), but with the argument order swapped. The copy is “untyped” in the sense that data may be uninitialized or otherwise violate the requirements of `T`. The initialization state is preserved exactly. Safety ------ Behavior is undefined if any of the following conditions are violated: * `src` must be [valid](index#safety) for reads of `count * size_of::<T>()` bytes. * `dst` must be [valid](index#safety) for writes of `count * size_of::<T>()` bytes. * Both `src` and `dst` must be properly aligned. * The region of memory beginning at `src` with a size of `count * size_of::<T>()` bytes must *not* overlap with the region of memory beginning at `dst` with the same size. Like [`read`](fn.read), `copy_nonoverlapping` creates a bitwise copy of `T`, regardless of whether `T` is [`Copy`](../marker/trait.copy "Copy"). If `T` is not [`Copy`](../marker/trait.copy "Copy"), using *both* the values in the region beginning at `*src` and the region beginning at `*dst` can [violate memory safety](fn.read#ownership-of-the-returned-value). Note that even if the effectively copied size (`count * size_of::<T>()`) is `0`, the pointers must be non-null and properly aligned. Examples -------- Manually implement [`Vec::append`](../vec/struct.vec#method.append): ``` use std::ptr; /// Moves all the elements of `src` into `dst`, leaving `src` empty. fn append<T>(dst: &mut Vec<T>, src: &mut Vec<T>) { let src_len = src.len(); let dst_len = dst.len(); // Ensure that `dst` has enough capacity to hold all of `src`. dst.reserve(src_len); unsafe { // The call to add is always safe because `Vec` will never // allocate more than `isize::MAX` bytes. let dst_ptr = dst.as_mut_ptr().add(dst_len); let src_ptr = src.as_ptr(); // Truncate `src` without dropping its contents. We do this first, // to avoid problems in case something further down panics. src.set_len(0); // The two regions cannot overlap because mutable references do // not alias, and two different vectors cannot own the same // memory. ptr::copy_nonoverlapping(src_ptr, dst_ptr, src_len); // Notify `dst` that it now holds the contents of `src`. dst.set_len(dst_len + src_len); } } let mut a = vec!['r']; let mut b = vec!['u', 's', 't']; append(&mut a, &mut b); assert_eq!(a, &['r', 'u', 's', 't']); assert!(b.is_empty()); ``` rust Function std::ptr::replace Function std::ptr::replace ========================== ``` pub unsafe fn replace<T>(dst: *mut T, src: T) -> T ``` Moves `src` into the pointed `dst`, returning the previous `dst` value. Neither value is dropped. This function is semantically equivalent to [`mem::replace`](../mem/fn.replace "mem::replace") except that it operates on raw pointers instead of references. When references are available, [`mem::replace`](../mem/fn.replace "mem::replace") should be preferred. Safety ------ Behavior is undefined if any of the following conditions are violated: * `dst` must be [valid](index#safety) for both reads and writes. * `dst` must be properly aligned. * `dst` must point to a properly initialized value of type `T`. Note that even if `T` has size `0`, the pointer must be non-null and properly aligned. Examples -------- ``` use std::ptr; let mut rust = vec!['b', 'u', 's', 't']; // `mem::replace` would have the same effect without requiring the unsafe // block. let b = unsafe { ptr::replace(&mut rust[0], 'r') }; assert_eq!(b, 'b'); assert_eq!(rust, &['r', 'u', 's', 't']); ``` rust Function std::ptr::write_bytes Function std::ptr::write\_bytes =============================== ``` pub unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) ``` Sets `count * size_of::<T>()` bytes of memory starting at `dst` to `val`. `write_bytes` is similar to C’s [`memset`](https://en.cppreference.com/w/c/string/byte/memset), but sets `count * size_of::<T>()` bytes to `val`. Safety ------ Behavior is undefined if any of the following conditions are violated: * `dst` must be [valid](index#safety) for writes of `count * size_of::<T>()` bytes. * `dst` must be properly aligned. Note that even if the effectively copied size (`count * size_of::<T>()`) is `0`, the pointer must be non-null and properly aligned. Additionally, note that changing `*dst` in this way can easily lead to undefined behavior (UB) later if the written bytes are not a valid representation of some `T`. For instance, the following is an **incorrect** use of this function: ``` unsafe { let mut value: u8 = 0; let ptr: *mut bool = &mut value as *mut u8 as *mut bool; let _bool = ptr.read(); // This is fine, `ptr` points to a valid `bool`. ptr.write_bytes(42u8, 1); // This function itself does not cause UB... let _bool = ptr.read(); // ...but it makes this operation UB! ⚠️ } ``` Examples -------- Basic usage: ``` use std::ptr; let mut vec = vec![0u32; 4]; unsafe { let vec_ptr = vec.as_mut_ptr(); ptr::write_bytes(vec_ptr, 0xfe, 2); } assert_eq!(vec, [0xfefefefe, 0xfefefefe, 0, 0]); ``` rust Trait std::ptr::Pointee Trait std::ptr::Pointee ======================= ``` pub trait Pointee { type Metadata: Copy + Send + Sync + Ord + Hash + Unpin; } ``` 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Provides the pointer metadata type of any pointed-to type. Pointer metadata ---------------- Raw pointer types and reference types in Rust can be thought of as made of two parts: a data pointer that contains the memory address of the value, and some metadata. For statically-sized types (that implement the `Sized` traits) as well as for `extern` types, pointers are said to be “thin”: metadata is zero-sized and its type is `()`. Pointers to [dynamically-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#dynamically-sized-types-dsts) are said to be “wide” or “fat”, they have non-zero-sized metadata: * For structs whose last field is a DST, metadata is the metadata for the last field * For the `str` type, metadata is the length in bytes as `usize` * For slice types like `[T]`, metadata is the length in items as `usize` * For trait objects like `dyn SomeTrait`, metadata is [`DynMetadata<Self>`](struct.dynmetadata "DynMetadata") (e.g. `DynMetadata<dyn SomeTrait>`) In the future, the Rust language may gain new kinds of types that have different pointer metadata. The `Pointee` trait ------------------- The point of this trait is its `Metadata` associated type, which is `()` or `usize` or `DynMetadata<_>` as described above. It is automatically implemented for every type. It can be assumed to be implemented in a generic context, even without a corresponding bound. Usage ----- Raw pointers can be decomposed into the data address and metadata components with their [`to_raw_parts`](../primitive.pointer#method.to_raw_parts) method. Alternatively, metadata alone can be extracted with the [`metadata`](fn.metadata "metadata") function. A reference can be passed to [`metadata`](fn.metadata "metadata") and implicitly coerced. A (possibly-wide) pointer can be put back together from its address and metadata with [`from_raw_parts`](fn.from_raw_parts "from_raw_parts") or [`from_raw_parts_mut`](fn.from_raw_parts_mut "from_raw_parts_mut"). Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ptr/metadata.rs.html#59)#### type Metadata: Copy + Send + Sync + Ord + Hash + Unpin 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) The type for metadata in pointers and references to `Self`. Implementors ------------ rust Function std::ptr::invalid_mut Function std::ptr::invalid\_mut =============================== ``` pub const fn invalid_mut<T>(addr: usize) -> *mut T ``` 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Creates an invalid mutable pointer with the given address. This is different from `addr as *mut T`, which creates a pointer that picks up a previously exposed provenance. See [`from_exposed_addr_mut`](fn.from_exposed_addr_mut "from_exposed_addr_mut") for more details on that operation. The module’s top-level documentation discusses the precise meaning of an “invalid” pointer but essentially this expresses that the pointer is not associated with any actual allocation and is little more than a usize address in disguise. This pointer will have no provenance associated with it and is therefore UB to read/write/offset. This mostly exists to facilitate things like `ptr::null` and `NonNull::dangling` which make invalid pointers. (Standard “Zero-Sized-Types get to cheat and lie” caveats apply, although it may be desirable to give them their own API just to make that 100% clear.) This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](index "crate::ptr") for details. rust Function std::ptr::slice_from_raw_parts Function std::ptr::slice\_from\_raw\_parts ========================================== ``` pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] ``` Forms a raw slice from a pointer and a length. The `len` argument is the number of **elements**, not the number of bytes. This function is safe, but actually using the return value is unsafe. See the documentation of [`slice::from_raw_parts`](../slice/fn.from_raw_parts) for slice safety requirements. Examples -------- ``` use std::ptr; // create a slice pointer when starting out with a pointer to the first element let x = [5, 6, 7]; let raw_pointer = x.as_ptr(); let slice = ptr::slice_from_raw_parts(raw_pointer, 3); assert_eq!(unsafe { &*slice }[2], 7); ``` rust Function std::ptr::swap_nonoverlapping Function std::ptr::swap\_nonoverlapping ======================================= ``` pub unsafe fn swap_nonoverlapping<T>(x: *mut T, y: *mut T, count: usize) ``` Swaps `count * size_of::<T>()` bytes between the two regions of memory beginning at `x` and `y`. The two regions must *not* overlap. The operation is “untyped” in the sense that data may be uninitialized or otherwise violate the requirements of `T`. The initialization state is preserved exactly. Safety ------ Behavior is undefined if any of the following conditions are violated: * Both `x` and `y` must be [valid](index#safety) for both reads and writes of `count * size_of::<T>()` bytes. * Both `x` and `y` must be properly aligned. * The region of memory beginning at `x` with a size of `count * size_of::<T>()` bytes must *not* overlap with the region of memory beginning at `y` with the same size. Note that even if the effectively copied size (`count * size_of::<T>()`) is `0`, the pointers must be non-null and properly aligned. Examples -------- Basic usage: ``` use std::ptr; let mut x = [1, 2, 3, 4]; let mut y = [7, 8, 9]; unsafe { ptr::swap_nonoverlapping(x.as_mut_ptr(), y.as_mut_ptr(), 2); } assert_eq!(x, [7, 8, 3, 4]); assert_eq!(y, [1, 2, 9]); ``` rust Function std::ptr::copy Function std::ptr::copy ======================= ``` pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) ``` Copies `count * size_of::<T>()` bytes from `src` to `dst`. The source and destination may overlap. If the source and destination will *never* overlap, [`copy_nonoverlapping`](fn.copy_nonoverlapping "copy_nonoverlapping") can be used instead. `copy` is semantically equivalent to C’s [`memmove`](https://en.cppreference.com/w/c/string/byte/memmove), but with the argument order swapped. Copying takes place as if the bytes were copied from `src` to a temporary array and then copied from the array to `dst`. The copy is “untyped” in the sense that data may be uninitialized or otherwise violate the requirements of `T`. The initialization state is preserved exactly. Safety ------ Behavior is undefined if any of the following conditions are violated: * `src` must be [valid](index#safety) for reads of `count * size_of::<T>()` bytes. * `dst` must be [valid](index#safety) for writes of `count * size_of::<T>()` bytes. * Both `src` and `dst` must be properly aligned. Like [`read`](fn.read), `copy` creates a bitwise copy of `T`, regardless of whether `T` is [`Copy`](../marker/trait.copy "Copy"). If `T` is not [`Copy`](../marker/trait.copy "Copy"), using both the values in the region beginning at `*src` and the region beginning at `*dst` can [violate memory safety](fn.read#ownership-of-the-returned-value). Note that even if the effectively copied size (`count * size_of::<T>()`) is `0`, the pointers must be non-null and properly aligned. Examples -------- Efficiently create a Rust vector from an unsafe buffer: ``` use std::ptr; /// # Safety /// /// * `ptr` must be correctly aligned for its type and non-zero. /// * `ptr` must be valid for reads of `elts` contiguous elements of type `T`. /// * Those elements must not be used after calling this function unless `T: Copy`. unsafe fn from_buf_raw<T>(ptr: *const T, elts: usize) -> Vec<T> { let mut dst = Vec::with_capacity(elts); // SAFETY: Our precondition ensures the source is aligned and valid, // and `Vec::with_capacity` ensures that we have usable space to write them. ptr::copy(ptr, dst.as_mut_ptr(), elts); // SAFETY: We created it with this much capacity earlier, // and the previous `copy` has initialized these elements. dst.set_len(elts); dst } ``` rust Function std::ptr::from_raw_parts Function std::ptr::from\_raw\_parts =================================== ``` pub fn from_raw_parts<T>(    data_address: *const (),    metadata: <T as Pointee>::Metadata) -> *const Twhere    T: ?Sized, ``` 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Forms a (possibly-wide) raw pointer from a data address and metadata. This function is safe but the returned pointer is not necessarily safe to dereference. For slices, see the documentation of [`slice::from_raw_parts`](../slice/fn.from_raw_parts) for safety requirements. For trait objects, the metadata must come from a pointer to the same underlying erased type. rust Struct std::ptr::NonNull Struct std::ptr::NonNull ======================== ``` #[repr(transparent)]pub struct NonNull<T>where    T: ?Sized,{ /* private fields */ } ``` `*mut T` but non-zero and [covariant](../../reference/subtyping). This is often the correct thing to use when building data structures using raw pointers, but is ultimately more dangerous to use because of its additional properties. If you’re not sure if you should use `NonNull<T>`, just use `*mut T`! Unlike `*mut T`, the pointer must always be non-null, even if the pointer is never dereferenced. This is so that enums may use this forbidden value as a discriminant – `Option<NonNull<T>>` has the same size as `*mut T`. However the pointer may still dangle if it isn’t dereferenced. Unlike `*mut T`, `NonNull<T>` was chosen to be covariant over `T`. This makes it possible to use `NonNull<T>` when building covariant types, but introduces the risk of unsoundness if used in a type that shouldn’t actually be covariant. (The opposite choice was made for `*mut T` even though technically the unsoundness could only be caused by calling unsafe functions.) Covariance is correct for most safe abstractions, such as `Box`, `Rc`, `Arc`, `Vec`, and `LinkedList`. This is the case because they provide a public API that follows the normal shared XOR mutable rules of Rust. If your type cannot safely be covariant, you must ensure it contains some additional field to provide invariance. Often this field will be a [`PhantomData`](../marker/struct.phantomdata) type like `PhantomData<Cell<T>>` or `PhantomData<&'a mut T>`. Notice that `NonNull<T>` has a `From` instance for `&T`. However, this does not change the fact that mutating through a (pointer derived from a) shared reference is undefined behavior unless the mutation happens inside an [`UnsafeCell<T>`](../cell/struct.unsafecell). The same goes for creating a mutable reference from a shared reference. When using this `From` instance without an `UnsafeCell<T>`, it is your responsibility to ensure that `as_mut` is never called, and `as_ptr` is never used for mutation. Implementations --------------- [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#66)### impl<T> NonNull<T> [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#90)const: 1.36.0 · #### pub const fn dangling() -> NonNull<T> Creates a new `NonNull` that is dangling, but well-aligned. This is useful for initializing types which lazily allocate, like `Vec::new` does. Note that the pointer value may potentially represent a valid pointer to a `T`, which means this must not be used as a “not yet initialized” sentinel value. Types that lazily allocate must track initialization by some other means. ##### Examples ``` use std::ptr::NonNull; let ptr = NonNull::<u32>::dangling(); // Important: don't try to access the value of `ptr` without // initializing it first! The pointer is not null but isn't valid either! ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#128)const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref") · #### pub unsafe fn as\_uninit\_ref<'a>(self) -> &'a MaybeUninit<T> 🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402)) Returns a shared references to the value. In contrast to [`as_ref`](struct.nonnull#method.as_ref), this does not require that the value has to be initialized. For the mutable counterpart see [`as_uninit_mut`](struct.nonnull#method.as_uninit_mut). ##### Safety When calling this method, you have to ensure that all of the following is true: * The pointer must be properly aligned. * It must be “dereferenceable” in the sense defined in [the module documentation](index#safety). * You must enforce Rust’s aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get mutated (except inside `UnsafeCell`). This applies even if the result of this method is unused! [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#162)const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref") · #### pub unsafe fn as\_uninit\_mut<'a>(self) -> &'a mut MaybeUninit<T> 🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402)) Returns a unique references to the value. In contrast to [`as_mut`](struct.nonnull#method.as_mut), this does not require that the value has to be initialized. For the shared counterpart see [`as_uninit_ref`](struct.nonnull#method.as_uninit_ref). ##### Safety When calling this method, you have to ensure that all of the following is true: * The pointer must be properly aligned. * It must be “dereferenceable” in the sense defined in [the module documentation](index#safety). * You must enforce Rust’s aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get accessed (read or written) through any other pointer. This applies even if the result of this method is unused! [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#169)### impl<T> NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#196)const: 1.25.0 · #### pub const unsafe fn new\_unchecked(ptr: \*mut T) -> NonNull<T> Creates a new `NonNull`. ##### Safety `ptr` must be non-null. ##### Examples ``` use std::ptr::NonNull; let mut x = 0u32; let ptr = unsafe { NonNull::new_unchecked(&mut x as *mut _) }; ``` *Incorrect* usage of this function: ``` use std::ptr::NonNull; // NEVER DO THAT!!! This is undefined behavior. ⚠️ let ptr = unsafe { NonNull::<u32>::new_unchecked(std::ptr::null_mut()) }; ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#218)const: [unstable](https://github.com/rust-lang/rust/issues/93235 "Tracking issue for const_nonnull_new") · #### pub fn new(ptr: \*mut T) -> Option<NonNull<T>> Creates a new `NonNull` if `ptr` is non-null. ##### Examples ``` use std::ptr::NonNull; let mut x = 0u32; let ptr = NonNull::<u32>::new(&mut x as *mut _).expect("ptr is null!"); if let Some(ptr) = NonNull::<u32>::new(std::ptr::null_mut()) { unreachable!(); } ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#236-239)const: [unstable](https://github.com/rust-lang/rust/issues/81513 "Tracking issue for ptr_metadata") · #### pub fn from\_raw\_parts( data\_address: NonNull<()>, metadata: <T as Pointee>::Metadata) -> NonNull<T> 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Performs the same functionality as [`std::ptr::from_raw_parts`](fn.from_raw_parts), except that a `NonNull` pointer is returned, as opposed to a raw `*const` pointer. See the documentation of [`std::ptr::from_raw_parts`](fn.from_raw_parts) for more details. [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#254)const: [unstable](https://github.com/rust-lang/rust/issues/81513 "Tracking issue for ptr_metadata") · #### pub fn to\_raw\_parts(self) -> (NonNull<()>, <T as Pointee>::Metadata) 🔬This is a nightly-only experimental API. (`ptr_metadata` [#81513](https://github.com/rust-lang/rust/issues/81513)) Decompose a (possibly wide) pointer into its address and metadata components. The pointer can be later reconstructed with [`NonNull::from_raw_parts`](struct.nonnull#method.from_raw_parts "NonNull::from_raw_parts"). [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#267-269)#### pub fn addr(self) -> NonZeroUsize 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Gets the “address” portion of the pointer. For more details see the equivalent method on a raw pointer, [`pointer::addr`](../primitive.pointer#method.addr "pointer::addr"). This API and its claimed semantics are part of the Strict Provenance experiment, see the [`ptr` module documentation](index "crate::ptr"). [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#285-287)#### pub fn with\_addr(self, addr: NonZeroUsize) -> NonNull<T> 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Creates a new pointer with the given address. For more details see the equivalent method on a raw pointer, [`pointer::with_addr`](../primitive.pointer#method.with_addr "pointer::with_addr"). This API and its claimed semantics are part of the Strict Provenance experiment, see the [`ptr` module documentation](index "crate::ptr"). [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#302-304)#### pub fn map\_addr(self, f: impl FnOnce(NonZeroUsize) -> NonZeroUsize) -> NonNull<T> 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Creates a new pointer by mapping `self`’s address to a new one. For more details see the equivalent method on a raw pointer, [`pointer::map_addr`](../primitive.pointer#method.map_addr "pointer::map_addr"). This API and its claimed semantics are part of the Strict Provenance experiment, see the [`ptr` module documentation](index "crate::ptr"). [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#330)const: 1.32.0 · #### pub const fn as\_ptr(self) -> \*mut T Acquires the underlying `*mut` pointer. ##### Examples ``` use std::ptr::NonNull; let mut x = 0u32; let ptr = NonNull::new(&mut x).expect("ptr is null!"); let x_value = unsafe { *ptr.as_ptr() }; assert_eq!(x_value, 0); unsafe { *ptr.as_ptr() += 2; } let x_value = unsafe { *ptr.as_ptr() }; assert_eq!(x_value, 2); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#378)const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref") · #### pub unsafe fn as\_ref<'a>(&self) -> &'a T Returns a shared reference to the value. If the value may be uninitialized, [`as_uninit_ref`](struct.nonnull#method.as_uninit_ref) must be used instead. For the mutable counterpart see [`as_mut`](struct.nonnull#method.as_mut). ##### Safety When calling this method, you have to ensure that all of the following is true: * The pointer must be properly aligned. * It must be “dereferenceable” in the sense defined in [the module documentation](index#safety). * The pointer must point to an initialized instance of `T`. * You must enforce Rust’s aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get mutated (except inside `UnsafeCell`). This applies even if the result of this method is unused! (The part about being initialized is not yet fully decided, but until it is, the only safe approach is to ensure that they are indeed initialized.) ##### Examples ``` use std::ptr::NonNull; let mut x = 0u32; let ptr = NonNull::new(&mut x as *mut _).expect("ptr is null!"); let ref_x = unsafe { ptr.as_ref() }; println!("{ref_x}"); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#429)const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref") · #### pub unsafe fn as\_mut<'a>(&mut self) -> &'a mut T Returns a unique reference to the value. If the value may be uninitialized, [`as_uninit_mut`](struct.nonnull#method.as_uninit_mut) must be used instead. For the shared counterpart see [`as_ref`](struct.nonnull#method.as_ref). ##### Safety When calling this method, you have to ensure that all of the following is true: * The pointer must be properly aligned. * It must be “dereferenceable” in the sense defined in [the module documentation](index#safety). * The pointer must point to an initialized instance of `T`. * You must enforce Rust’s aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get accessed (read or written) through any other pointer. This applies even if the result of this method is unused! (The part about being initialized is not yet fully decided, but until it is, the only safe approach is to ensure that they are indeed initialized.) ##### Examples ``` use std::ptr::NonNull; let mut x = 0u32; let mut ptr = NonNull::new(&mut x).expect("null pointer"); let x_ref = unsafe { ptr.as_mut() }; assert_eq!(*x_ref, 0); *x_ref += 2; assert_eq!(*x_ref, 2); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#453)1.27.0 (const: 1.36.0) · #### pub const fn cast<U>(self) -> NonNull<U> Casts to a pointer of another type. ##### Examples ``` use std::ptr::NonNull; let mut x = 0u32; let ptr = NonNull::new(&mut x as *mut _).expect("null pointer"); let casted_ptr = ptr.cast::<i8>(); let raw_ptr: *mut i8 = casted_ptr.as_ptr(); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#459)### impl<T> NonNull<[T]> [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#487)const: [unstable](https://github.com/rust-lang/rust/issues/71941 "Tracking issue for const_nonnull_slice_from_raw_parts") · #### pub fn slice\_from\_raw\_parts(data: NonNull<T>, len: usize) -> NonNull<[T]> 🔬This is a nightly-only experimental API. (`nonnull_slice_from_raw_parts` [#71941](https://github.com/rust-lang/rust/issues/71941)) Creates a non-null raw slice from a thin pointer and a length. The `len` argument is the number of **elements**, not the number of bytes. This function is safe, but dereferencing the return value is unsafe. See the documentation of [`slice::from_raw_parts`](../slice/fn.from_raw_parts "slice::from_raw_parts") for slice safety requirements. ##### Examples ``` #![feature(nonnull_slice_from_raw_parts)] use std::ptr::NonNull; // create a slice pointer when starting out with a pointer to the first element let mut x = [5, 6, 7]; let nonnull_pointer = NonNull::new(x.as_mut_ptr()).unwrap(); let slice = NonNull::slice_from_raw_parts(nonnull_pointer, 3); assert_eq!(unsafe { slice.as_ref()[2] }, 7); ``` (Note that this example artificially demonstrates a use of this method, but `let slice = NonNull::from(&x[..]);` would be a better way to write code like this.) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#513)1.63.0 (const: 1.63.0) · #### pub const fn len(self) -> usize Returns the length of a non-null raw slice. The returned value is the number of **elements**, not the number of bytes. This function is safe, even when the non-null raw slice cannot be dereferenced to a slice because the pointer does not have a valid address. ##### Examples ``` #![feature(nonnull_slice_from_raw_parts)] use std::ptr::NonNull; let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3); assert_eq!(slice.len(), 3); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#532)const: [unstable](https://github.com/rust-lang/rust/issues/74265 "Tracking issue for slice_ptr_get") · #### pub fn as\_non\_null\_ptr(self) -> NonNull<T> 🔬This is a nightly-only experimental API. (`slice_ptr_get` [#74265](https://github.com/rust-lang/rust/issues/74265)) Returns a non-null pointer to the slice’s buffer. ##### Examples ``` #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)] use std::ptr::NonNull; let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3); assert_eq!(slice.as_non_null_ptr(), NonNull::<i8>::dangling()); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#552)const: [unstable](https://github.com/rust-lang/rust/issues/74265 "Tracking issue for slice_ptr_get") · #### pub fn as\_mut\_ptr(self) -> \*mut T 🔬This is a nightly-only experimental API. (`slice_ptr_get` [#74265](https://github.com/rust-lang/rust/issues/74265)) Returns a raw pointer to the slice’s buffer. ##### Examples ``` #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)] use std::ptr::NonNull; let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3); assert_eq!(slice.as_mut_ptr(), NonNull::<i8>::dangling().as_ptr()); ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#597)const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref") · #### pub unsafe fn as\_uninit\_slice<'a>(self) -> &'a [MaybeUninit<T>] 🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402)) Returns a shared reference to a slice of possibly uninitialized values. In contrast to [`as_ref`](struct.nonnull#method.as_ref), this does not require that the value has to be initialized. For the mutable counterpart see [`as_uninit_slice_mut`](struct.nonnull#method.as_uninit_slice_mut). ##### Safety When calling this method, you have to ensure that all of the following is true: * The pointer must be [valid](index#safety) for reads for `ptr.len() * mem::size_of::<T>()` many bytes, and it must be properly aligned. This means in particular: + The entire memory range of this slice must be contained within a single allocated object! Slices can never span across multiple allocated objects. + The pointer must be aligned even for zero-length slices. One reason for this is that enum layout optimizations may rely on references (including slices of any length) being aligned and non-null to distinguish them from other data. You can obtain a pointer that is usable as `data` for zero-length slices using [`NonNull::dangling()`](struct.nonnull#method.dangling "NonNull::dangling()"). * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`. See the safety documentation of [`pointer::offset`](../primitive.pointer#method.offset "pointer::offset"). * You must enforce Rust’s aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get mutated (except inside `UnsafeCell`). This applies even if the result of this method is unused! See also [`slice::from_raw_parts`](../slice/fn.from_raw_parts "slice::from_raw_parts"). [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#660)const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref") · #### pub unsafe fn as\_uninit\_slice\_mut<'a>(self) -> &'a mut [MaybeUninit<T>] 🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402)) Returns a unique reference to a slice of possibly uninitialized values. In contrast to [`as_mut`](struct.nonnull#method.as_mut), this does not require that the value has to be initialized. For the shared counterpart see [`as_uninit_slice`](struct.nonnull#method.as_uninit_slice). ##### Safety When calling this method, you have to ensure that all of the following is true: * The pointer must be [valid](index#safety) for reads and writes for `ptr.len() * mem::size_of::<T>()` many bytes, and it must be properly aligned. This means in particular: + The entire memory range of this slice must be contained within a single allocated object! Slices can never span across multiple allocated objects. + The pointer must be aligned even for zero-length slices. One reason for this is that enum layout optimizations may rely on references (including slices of any length) being aligned and non-null to distinguish them from other data. You can obtain a pointer that is usable as `data` for zero-length slices using [`NonNull::dangling()`](struct.nonnull#method.dangling "NonNull::dangling()"). * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`. See the safety documentation of [`pointer::offset`](../primitive.pointer#method.offset "pointer::offset"). * You must enforce Rust’s aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get accessed (read or written) through any other pointer. This applies even if the result of this method is unused! See also [`slice::from_raw_parts_mut`](../slice/fn.from_raw_parts_mut "slice::from_raw_parts_mut"). ##### Examples ``` #![feature(allocator_api, ptr_as_uninit)] use std::alloc::{Allocator, Layout, Global}; use std::mem::MaybeUninit; use std::ptr::NonNull; let memory: NonNull<[u8]> = Global.allocate(Layout::new::<[u8; 32]>())?; // This is safe as `memory` is valid for reads and writes for `memory.len()` many bytes. // Note that calling `memory.as_mut()` is not allowed here as the content may be uninitialized. let slice: &mut [MaybeUninit<u8>] = unsafe { memory.as_uninit_slice_mut() }; ``` [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#689-691)const: unstable · #### pub unsafe fn get\_unchecked\_mut<I>( self, index: I) -> NonNull<<I as SliceIndex<[T]>>::Output>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, 🔬This is a nightly-only experimental API. (`slice_ptr_get` [#74265](https://github.com/rust-lang/rust/issues/74265)) Returns a raw pointer to an element or subslice, without doing bounds checking. Calling this method with an out-of-bounds index or when `self` is not dereferenceable is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting pointer is not used. ##### Examples ``` #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)] use std::ptr::NonNull; let x = &mut [1, 2, 4]; let x = NonNull::slice_from_raw_parts(NonNull::new(x.as_mut_ptr()).unwrap(), x.len()); unsafe { assert_eq!(x.get_unchecked_mut(1).as_ptr(), x.as_non_null_ptr().as_ptr().add(1)); } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#701)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · ### impl<T> Clone for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#703)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> NonNull<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#718)### impl<T> Debug for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#719)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#792)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> From<&T> for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#797)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(reference: &T) -> NonNull<T> Converts a `&T` to a `NonNull<T>`. This conversion is safe and infallible since references cannot be null. [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#779)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> From<&mut T> for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#784)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(reference: &mut T) -> NonNull<T> Converts a `&mut T` to a `NonNull<T>`. This conversion is safe and infallible since references cannot be null. [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#759)### impl<T> Hash for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#761)#### fn hash<H>(&self, state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#743)### impl<T> Ord for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#745)#### fn cmp(&self, other: &NonNull<T>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#735)### impl<T> PartialEq<NonNull<T>> for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#737)#### fn eq(&self, other: &NonNull<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#751)### impl<T> PartialOrd<NonNull<T>> for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#753)#### fn partial\_cmp(&self, other: &NonNull<T>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#725)### impl<T> Pointer for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#726)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#712)### impl<T, U> CoerceUnsized<NonNull<U>> for NonNull<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#709)### impl<T> Copy for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#715)### impl<T, U> DispatchFromDyn<NonNull<U>> for NonNull<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#732)### impl<T> Eq for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#59)### impl<T> !Send for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), `NonNull` pointers are not `Send` because the data they reference may be aliased. [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#64)### impl<T> !Sync for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), `NonNull` pointers are not `Sync` because the data they reference may be aliased. [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#191)### impl<T> UnwindSafe for NonNull<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Auto Trait Implementations -------------------------- ### impl<T: ?Sized> RefUnwindSafe for NonNull<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T: ?Sized> Unpin for NonNull<T> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Function std::ptr::read_unaligned Function std::ptr::read\_unaligned ================================== ``` pub unsafe fn read_unaligned<T>(src: *const T) -> T ``` Reads the value from `src` without moving it. This leaves the memory in `src` unchanged. Unlike [`read`](fn.read "read"), `read_unaligned` works with unaligned pointers. Safety ------ Behavior is undefined if any of the following conditions are violated: * `src` must be [valid](index#safety) for reads. * `src` must point to a properly initialized value of type `T`. Like [`read`](fn.read "read"), `read_unaligned` creates a bitwise copy of `T`, regardless of whether `T` is [`Copy`](../marker/trait.copy "Copy"). If `T` is not [`Copy`](../marker/trait.copy "Copy"), using both the returned value and the value at `*src` can [violate memory safety](fn.read#ownership-of-the-returned-value). Note that even if `T` has size `0`, the pointer must be non-null. ### On `packed` structs Attempting to create a raw pointer to an `unaligned` struct field with an expression such as `&packed.unaligned as *const FieldType` creates an intermediate unaligned reference before converting that to a raw pointer. That this reference is temporary and immediately cast is inconsequential as the compiler always expects references to be properly aligned. As a result, using `&packed.unaligned as *const FieldType` causes immediate *undefined behavior* in your program. Instead you must use the [`ptr::addr_of!`](macro.addr_of) macro to create the pointer. You may use that returned pointer together with this function. An example of what not to do and how this relates to `read_unaligned` is: ``` #[repr(packed, C)] struct Packed { _padding: u8, unaligned: u32, } let packed = Packed { _padding: 0x00, unaligned: 0x01020304, }; // Take the address of a 32-bit integer which is not aligned. // In contrast to `&packed.unaligned as *const _`, this has no undefined behavior. let unaligned = std::ptr::addr_of!(packed.unaligned); let v = unsafe { std::ptr::read_unaligned(unaligned) }; assert_eq!(v, 0x01020304); ``` Accessing unaligned fields directly with e.g. `packed.unaligned` is safe however. Examples -------- Read a usize value from a byte buffer: ``` use std::mem; fn read_usize(x: &[u8]) -> usize { assert!(x.len() >= mem::size_of::<usize>()); let ptr = x.as_ptr() as *const usize; unsafe { ptr.read_unaligned() } } ``` rust Function std::ptr::from_exposed_addr Function std::ptr::from\_exposed\_addr ====================================== ``` pub fn from_exposed_addr<T>(addr: usize) -> *const T ``` 🔬This is a nightly-only experimental API. (`strict_provenance` [#95228](https://github.com/rust-lang/rust/issues/95228)) Convert an address back to a pointer, picking up a previously ‘exposed’ provenance. This is equivalent to `addr as *const T`. The provenance of the returned pointer is that of *any* pointer that was previously passed to [`expose_addr`](../primitive.pointer#method.expose_addr "pointer::expose_addr") or a `ptr as usize` cast. If there is no previously ‘exposed’ provenance that justifies the way this pointer will be used, the program has undefined behavior. Note that there is no algorithm that decides which provenance will be used. You can think of this as “guessing” the right provenance, and the guess will be “maximally in your favor”, in the sense that if there is any way to avoid undefined behavior, then that is the guess that will be taken. On platforms with multiple address spaces, it is your responsibility to ensure that the address makes sense in the address space that this pointer will be used with. Using this method means that code is *not* following strict provenance rules. “Guessing” a suitable provenance complicates specification and reasoning and may not be supported by tools that help you to stay conformant with the Rust memory model, so it is recommended to use [`with_addr`](../primitive.pointer#method.with_addr "pointer::with_addr") wherever possible. On most platforms this will produce a value with the same bytes as the address. Platforms which need to store additional information in a pointer may not support this operation, since it is generally not possible to actually *compute* which provenance the returned pointer has to pick up. This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](index "crate::ptr") for details. rust Macro std::arch::is_x86_feature_detected Macro std::arch::is\_x86\_feature\_detected =========================================== ``` macro_rules! is_x86_feature_detected { ("aes") => { ... }; ("pclmulqdq") => { ... }; ("rdrand") => { ... }; ("rdseed") => { ... }; ("tsc") => { ... }; ("mmx") => { ... }; ("sse") => { ... }; ("sse2") => { ... }; ("sse3") => { ... }; ("ssse3") => { ... }; ("sse4.1") => { ... }; ("sse4.2") => { ... }; ("sse4a") => { ... }; ("sha") => { ... }; ("avx") => { ... }; ("avx2") => { ... }; ("avx512f") => { ... }; ("avx512cd") => { ... }; ("avx512er") => { ... }; ("avx512pf") => { ... }; ("avx512bw") => { ... }; ("avx512dq") => { ... }; ("avx512vl") => { ... }; ("avx512ifma") => { ... }; ("avx512vbmi") => { ... }; ("avx512vpopcntdq") => { ... }; ("avx512vbmi2") => { ... }; ("avx512gfni") => { ... }; ("avx512vaes") => { ... }; ("avx512vpclmulqdq") => { ... }; ("avx512vnni") => { ... }; ("avx512bitalg") => { ... }; ("avx512bf16") => { ... }; ("avx512vp2intersect") => { ... }; ("f16c") => { ... }; ("fma") => { ... }; ("bmi1") => { ... }; ("bmi2") => { ... }; ("lzcnt") => { ... }; ("tbm") => { ... }; ("popcnt") => { ... }; ("fxsr") => { ... }; ("xsave") => { ... }; ("xsaveopt") => { ... }; ("xsaves") => { ... }; ("xsavec") => { ... }; ("cmpxchg16b") => { ... }; ("adx") => { ... }; ("rtm") => { ... }; ("abm") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` Available on **x86 or x86-64** only.A macro to test at *runtime* whether a CPU feature is available on x86/x86-64 platforms. This macro is provided in the standard library and will detect at runtime whether the specified CPU feature is detected. This does **not** resolve at compile time unless the specified feature is already enabled for the entire crate. Runtime detection currently relies mostly on the `cpuid` instruction. This macro only takes one argument which is a string literal of the feature being tested for. The feature names supported are the lowercase versions of the ones defined by Intel in [their documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide). ### Supported arguments This macro supports the same names that `#[target_feature]` supports. Unlike `#[target_feature]`, however, this macro does not support names separated with a comma. Instead testing for multiple features must be done through separate macro invocations for now. Supported arguments are: * `"aes"` * `"pclmulqdq"` * `"rdrand"` * `"rdseed"` * `"tsc"` * `"mmx"` * `"sse"` * `"sse2"` * `"sse3"` * `"ssse3"` * `"sse4.1"` * `"sse4.2"` * `"sse4a"` * `"sha"` * `"avx"` * `"avx2"` * `"avx512f"` * `"avx512cd"` * `"avx512er"` * `"avx512pf"` * `"avx512bw"` * `"avx512dq"` * `"avx512vl"` * `"avx512ifma"` * `"avx512vbmi"` * `"avx512vpopcntdq"` * `"avx512vbmi2"` * `"avx512gfni"` * `"avx512vaes"` * `"avx512vpclmulqdq"` * `"avx512vnni"` * `"avx512bitalg"` * `"avx512bf16"` * `"avx512vp2intersect"` * `"f16c"` * `"fma"` * `"bmi1"` * `"bmi2"` * `"abm"` * `"lzcnt"` * `"tbm"` * `"popcnt"` * `"fxsr"` * `"xsave"` * `"xsaveopt"` * `"xsaves"` * `"xsavec"` * `"cmpxchg16b"` * `"adx"` * `"rtm"` rust Macro std::arch::is_mips_feature_detected Macro std::arch::is\_mips\_feature\_detected ============================================ ``` macro_rules! is_mips_feature_detected { ("msa") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` 🔬This is a nightly-only experimental API. (`stdsimd` [#27731](https://github.com/rust-lang/rust/issues/27731)) Available on **MIPS** only.Checks if `mips` feature is enabled. rust Module std::arch Module std::arch ================ SIMD and vendor intrinsics module. This module is intended to be the gateway to architecture-specific intrinsic functions, typically related to SIMD (but not always!). Each architecture that Rust compiles to may contain a submodule here, which means that this is not a portable module! If you’re writing a portable library take care when using these APIs! Under this module you’ll find an architecture-named module, such as `x86_64`. Each `#[cfg(target_arch)]` that Rust can compile to may have a module entry here, only present on that particular target. For example the `i686-pc-windows-msvc` target will have an `x86` module here, whereas `x86_64-pc-windows-msvc` has `x86_64`. Overview -------- This module exposes vendor-specific intrinsics that typically correspond to a single machine instruction. These intrinsics are not portable: their availability is architecture-dependent, and not all machines of that architecture might provide the intrinsic. The `arch` module is intended to be a low-level implementation detail for higher-level APIs. Using it correctly can be quite tricky as you need to ensure at least a few guarantees are upheld: * The correct architecture’s module is used. For example the `arm` module isn’t available on the `x86_64-unknown-linux-gnu` target. This is typically done by ensuring that `#[cfg]` is used appropriately when using this module. * The CPU the program is currently running on supports the function being called. For example it is unsafe to call an AVX2 function on a CPU that doesn’t actually support AVX2. As a result of the latter of these guarantees all intrinsics in this module are `unsafe` and extra care needs to be taken when calling them! CPU Feature Detection --------------------- In order to call these APIs in a safe fashion there’s a number of mechanisms available to ensure that the correct CPU feature is available to call an intrinsic. Let’s consider, for example, the `_mm256_add_epi64` intrinsics on the `x86` and `x86_64` architectures. This function requires the AVX2 feature as [documented by Intel](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_add_epi64&expand=100) so to correctly call this function we need to (a) guarantee we only call it on `x86`/`x86_64` and (b) ensure that the CPU feature is available ### Static CPU Feature Detection The first option available to us is to conditionally compile code via the `#[cfg]` attribute. CPU features correspond to the `target_feature` cfg available, and can be used like so: ⓘ ``` #[cfg( all( any(target_arch = "x86", target_arch = "x86_64"), target_feature = "avx2" ) )] fn foo() { #[cfg(target_arch = "x86")] use std::arch::x86::_mm256_add_epi64; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::_mm256_add_epi64; unsafe { _mm256_add_epi64(...); } } ``` Here we’re using `#[cfg(target_feature = "avx2")]` to conditionally compile this function into our module. This means that if the `avx2` feature is *enabled statically* then we’ll use the `_mm256_add_epi64` function at runtime. The `unsafe` block here can be justified through the usage of `#[cfg]` to only compile the code in situations where the safety guarantees are upheld. Statically enabling a feature is typically done with the `-C target-feature` or `-C target-cpu` flags to the compiler. For example if your local CPU supports AVX2 then you can compile the above function with: ``` $ RUSTFLAGS='-C target-cpu=native' cargo build ``` Or otherwise you can specifically enable just the AVX2 feature: ``` $ RUSTFLAGS='-C target-feature=+avx2' cargo build ``` Note that when you compile a binary with a particular feature enabled it’s important to ensure that you only run the binary on systems which satisfy the required feature set. ### Dynamic CPU Feature Detection Sometimes statically dispatching isn’t quite what you want. Instead you might want to build a portable binary that runs across a variety of CPUs, but at runtime it selects the most optimized implementation available. This allows you to build a “least common denominator” binary which has certain sections more optimized for different CPUs. Taking our previous example from before, we’re going to compile our binary *without* AVX2 support, but we’d like to enable it for just one function. We can do that in a manner like: ⓘ ``` fn foo() { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { if is_x86_feature_detected!("avx2") { return unsafe { foo_avx2() }; } } // fallback implementation without using AVX2 } #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[target_feature(enable = "avx2")] unsafe fn foo_avx2() { #[cfg(target_arch = "x86")] use std::arch::x86::_mm256_add_epi64; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::_mm256_add_epi64; _mm256_add_epi64(...); } ``` There’s a couple of components in play here, so let’s go through them in detail! * First up we notice the `is_x86_feature_detected!` macro. Provided by the standard library, this macro will perform necessary runtime detection to determine whether the CPU the program is running on supports the specified feature. In this case the macro will expand to a boolean expression evaluating to whether the local CPU has the AVX2 feature or not. Note that this macro, like the `arch` module, is platform-specific. For example calling `is_x86_feature_detected!("avx2")` on ARM will be a compile time error. To ensure we don’t hit this error a statement level `#[cfg]` is used to only compile usage of the macro on `x86`/`x86_64`. * Next up we see our AVX2-enabled function, `foo_avx2`. This function is decorated with the `#[target_feature]` attribute which enables a CPU feature for just this one function. Using a compiler flag like `-C target-feature=+avx2` will enable AVX2 for the entire program, but using an attribute will only enable it for the one function. Usage of the `#[target_feature]` attribute currently requires the function to also be `unsafe`, as we see here. This is because the function can only be correctly called on systems which have the AVX2 (like the intrinsics themselves). And with all that we should have a working program! This program will run across all machines and it’ll use the optimized AVX2 implementation on machines where support is detected. Ergonomics ---------- It’s important to note that using the `arch` module is not the easiest thing in the world, so if you’re curious to try it out you may want to brace yourself for some wordiness! The primary purpose of this module is to enable stable crates on crates.io to build up much more ergonomic abstractions which end up using SIMD under the hood. Over time these abstractions may also move into the standard library itself, but for now this module is tasked with providing the bare minimum necessary to use vendor intrinsics on stable Rust. Other architectures ------------------- This documentation is only for one particular architecture, you can find others at: * [`x86`](https://doc.rust-lang.org/core/arch/x86/index.html) * [`x86_64`](https://doc.rust-lang.org/core/arch/x86_64/index.html) * [`arm`](https://doc.rust-lang.org/core/arch/arm/index.html) * [`aarch64`](https://doc.rust-lang.org/core/arch/aarch64/index.html) * [`riscv32`](https://doc.rust-lang.org/core/arch/riscv32/index.html) * [`riscv64`](https://doc.rust-lang.org/core/arch/riscv64/index.html) * [`mips`](https://doc.rust-lang.org/core/arch/mips/index.html) * [`mips64`](https://doc.rust-lang.org/core/arch/mips64/index.html) * [`powerpc`](https://doc.rust-lang.org/core/arch/powerpc/index.html) * [`powerpc64`](https://doc.rust-lang.org/core/arch/powerpc64/index.html) * [`nvptx`](https://doc.rust-lang.org/core/arch/nvptx/index.html) * [`wasm32`](https://doc.rust-lang.org/core/arch/wasm32/index.html) Examples -------- First let’s take a look at not actually using any intrinsics but instead using LLVM’s auto-vectorization to produce optimized vectorized code for AVX2 and also for the default platform. ``` fn main() { let mut dst = [0]; add_quickly(&[1], &[2], &mut dst); assert_eq!(dst[0], 3); } fn add_quickly(a: &[u8], b: &[u8], c: &mut [u8]) { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { // Note that this `unsafe` block is safe because we're testing // that the `avx2` feature is indeed available on our CPU. if is_x86_feature_detected!("avx2") { return unsafe { add_quickly_avx2(a, b, c) }; } } add_quickly_fallback(a, b, c) } #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[target_feature(enable = "avx2")] unsafe fn add_quickly_avx2(a: &[u8], b: &[u8], c: &mut [u8]) { add_quickly_fallback(a, b, c) // the function below is inlined here } fn add_quickly_fallback(a: &[u8], b: &[u8], c: &mut [u8]) { for ((a, b), c) in a.iter().zip(b).zip(c) { *c = *a + *b; } } ``` Next up let’s take a look at an example of manually using intrinsics. Here we’ll be using SSE4.1 features to implement hex encoding. ``` fn main() { let mut dst = [0; 32]; hex_encode(b"\x01\x02\x03", &mut dst); assert_eq!(&dst[..6], b"010203"); let mut src = [0; 16]; for i in 0..16 { src[i] = (i + 1) as u8; } hex_encode(&src, &mut dst); assert_eq!(&dst, b"0102030405060708090a0b0c0d0e0f10"); } pub fn hex_encode(src: &[u8], dst: &mut [u8]) { let len = src.len().checked_mul(2).unwrap(); assert!(dst.len() >= len); #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { if is_x86_feature_detected!("sse4.1") { return unsafe { hex_encode_sse41(src, dst) }; } } hex_encode_fallback(src, dst) } // translated from // <https://github.com/Matherunner/bin2hex-sse/blob/master/base16_sse4.cpp> #[target_feature(enable = "sse4.1")] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] unsafe fn hex_encode_sse41(mut src: &[u8], dst: &mut [u8]) { #[cfg(target_arch = "x86")] use std::arch::x86::*; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::*; let ascii_zero = _mm_set1_epi8(b'0' as i8); let nines = _mm_set1_epi8(9); let ascii_a = _mm_set1_epi8((b'a' - 9 - 1) as i8); let and4bits = _mm_set1_epi8(0xf); let mut i = 0_isize; while src.len() >= 16 { let invec = _mm_loadu_si128(src.as_ptr() as *const _); let masked1 = _mm_and_si128(invec, and4bits); let masked2 = _mm_and_si128(_mm_srli_epi64(invec, 4), and4bits); // return 0xff corresponding to the elements > 9, or 0x00 otherwise let cmpmask1 = _mm_cmpgt_epi8(masked1, nines); let cmpmask2 = _mm_cmpgt_epi8(masked2, nines); // add '0' or the offset depending on the masks let masked1 = _mm_add_epi8( masked1, _mm_blendv_epi8(ascii_zero, ascii_a, cmpmask1), ); let masked2 = _mm_add_epi8( masked2, _mm_blendv_epi8(ascii_zero, ascii_a, cmpmask2), ); // interleave masked1 and masked2 bytes let res1 = _mm_unpacklo_epi8(masked2, masked1); let res2 = _mm_unpackhi_epi8(masked2, masked1); _mm_storeu_si128(dst.as_mut_ptr().offset(i * 2) as *mut _, res1); _mm_storeu_si128( dst.as_mut_ptr().offset(i * 2 + 16) as *mut _, res2, ); src = &src[16..]; i += 16; } let i = i as usize; hex_encode_fallback(src, &mut dst[i * 2..]); } fn hex_encode_fallback(src: &[u8], dst: &mut [u8]) { fn hex(byte: u8) -> u8 { static TABLE: &[u8] = b"0123456789abcdef"; TABLE[byte as usize] } for (byte, slots) in src.iter().zip(dst.chunks_mut(2)) { slots[0] = hex((*byte >> 4) & 0xf); slots[1] = hex(*byte & 0xf); } } ``` Re-exports ---------- `pub use core::[arch](https://doc.rust-lang.org/core/arch/index.html "mod core::arch")::*;` Macros ------ [is\_arm\_feature\_detected](macro.is_arm_feature_detected "std::arch::is_arm_feature_detected macro")ExperimentalARM Checks if `arm` feature is enabled. [is\_mips64\_feature\_detected](macro.is_mips64_feature_detected "std::arch::is_mips64_feature_detected macro")ExperimentalMIPS-64 Checks if `mips64` feature is enabled. [is\_mips\_feature\_detected](macro.is_mips_feature_detected "std::arch::is_mips_feature_detected macro")ExperimentalMIPS Checks if `mips` feature is enabled. [is\_powerpc64\_feature\_detected](macro.is_powerpc64_feature_detected "std::arch::is_powerpc64_feature_detected macro")ExperimentalPowerPC-64 Checks if `powerpc` feature is enabled. [is\_powerpc\_feature\_detected](macro.is_powerpc_feature_detected "std::arch::is_powerpc_feature_detected macro")ExperimentalPowerPC Checks if `powerpc` feature is enabled. [is\_riscv\_feature\_detected](macro.is_riscv_feature_detected "std::arch::is_riscv_feature_detected macro")ExperimentalRISC-V RV32 or RISC-V RV64 A macro to test at *runtime* whether instruction sets are available on RISC-V platforms. [is\_aarch64\_feature\_detected](macro.is_aarch64_feature_detected "std::arch::is_aarch64_feature_detected macro")AArch64 This macro tests, at runtime, whether an `aarch64` feature is enabled on aarch64 platforms. Currently most features are only supported on linux-based platforms. [is\_x86\_feature\_detected](macro.is_x86_feature_detected "std::arch::is_x86_feature_detected macro")x86 or x86-64 A macro to test at *runtime* whether a CPU feature is available on x86/x86-64 platforms.
programming_docs
rust Macro std::arch::is_aarch64_feature_detected Macro std::arch::is\_aarch64\_feature\_detected =============================================== ``` macro_rules! is_aarch64_feature_detected { ("neon") => { ... }; ("pmull") => { ... }; ("fp") => { ... }; ("fp16") => { ... }; ("sve") => { ... }; ("crc") => { ... }; ("lse") => { ... }; ("lse2") => { ... }; ("rdm") => { ... }; ("rcpc") => { ... }; ("rcpc2") => { ... }; ("dotprod") => { ... }; ("tme") => { ... }; ("fhm") => { ... }; ("dit") => { ... }; ("flagm") => { ... }; ("ssbs") => { ... }; ("sb") => { ... }; ("paca") => { ... }; ("pacg") => { ... }; ("dpb") => { ... }; ("dpb2") => { ... }; ("sve2") => { ... }; ("sve2-aes") => { ... }; ("sve2-sm4") => { ... }; ("sve2-sha3") => { ... }; ("sve2-bitperm") => { ... }; ("frintts") => { ... }; ("i8mm") => { ... }; ("f32mm") => { ... }; ("f64mm") => { ... }; ("bf16") => { ... }; ("rand") => { ... }; ("bti") => { ... }; ("mte") => { ... }; ("jsconv") => { ... }; ("fcma") => { ... }; ("aes") => { ... }; ("sha2") => { ... }; ("sha3") => { ... }; ("sm4") => { ... }; ("asimd") => { ... }; ("ras") => { ... }; ("v8.1a") => { ... }; ("v8.2a") => { ... }; ("v8.3a") => { ... }; ("v8.4a") => { ... }; ("v8.5a") => { ... }; ("v8.6a") => { ... }; ("v8.7a") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` Available on **AArch64** only.This macro tests, at runtime, whether an `aarch64` feature is enabled on aarch64 platforms. Currently most features are only supported on linux-based platforms. This macro takes one argument which is a string literal of the feature being tested for. The feature names are mostly taken from their FEAT\_\* definitions in the [ARM Architecture Reference Manual](https://developer.arm.com/documentation/ddi0487/latest). ### Supported arguments * `"asimd"` or “neon” - FEAT\_AdvSIMD * `"pmull"` - FEAT\_PMULL * `"fp"` - FEAT\_FP * `"fp16"` - FEAT\_FP16 * `"sve"` - FEAT\_SVE * `"crc"` - FEAT\_CRC * `"lse"` - FEAT\_LSE * `"lse2"` - FEAT\_LSE2 * `"rdm"` - FEAT\_RDM * `"rcpc"` - FEAT\_LRCPC * `"rcpc2"` - FEAT\_LRCPC2 * `"dotprod"` - FEAT\_DotProd * `"tme"` - FEAT\_TME * `"fhm"` - FEAT\_FHM * `"dit"` - FEAT\_DIT * `"flagm"` - FEAT\_FLAGM * `"ssbs"` - FEAT\_SSBS * `"sb"` - FEAT\_SB * `"paca"` - FEAT\_PAuth (address authentication) * `"pacg"` - FEAT\_Pauth (generic authentication) * `"dpb"` - FEAT\_DPB * `"dpb2"` - FEAT\_DPB2 * `"sve2"` - FEAT\_SVE2 * `"sve2-aes"` - FEAT\_SVE2\_AES * `"sve2-sm4"` - FEAT\_SVE2\_SM4 * `"sve2-sha3"` - FEAT\_SVE2\_SHA3 * `"sve2-bitperm"` - FEAT\_SVE2\_BitPerm * `"frintts"` - FEAT\_FRINTTS * `"i8mm"` - FEAT\_I8MM * `"f32mm"` - FEAT\_F32MM * `"f64mm"` - FEAT\_F64MM * `"bf16"` - FEAT\_BF16 * `"rand"` - FEAT\_RNG * `"bti"` - FEAT\_BTI * `"mte"` - FEAT\_MTE * `"jsconv"` - FEAT\_JSCVT * `"fcma"` - FEAT\_FCMA * `"aes"` - FEAT\_AES * `"sha2"` - FEAT\_SHA1 & FEAT\_SHA256 * `"sha3"` - FEAT\_SHA512 & FEAT\_SHA3 * `"sm4"` - FEAT\_SM3 & FEAT\_SM4 rust Macro std::arch::is_powerpc64_feature_detected Macro std::arch::is\_powerpc64\_feature\_detected ================================================= ``` macro_rules! is_powerpc64_feature_detected { ("altivec") => { ... }; ("vsx") => { ... }; ("power8") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` 🔬This is a nightly-only experimental API. (`stdsimd` [#27731](https://github.com/rust-lang/rust/issues/27731)) Available on **PowerPC-64** only.Checks if `powerpc` feature is enabled. rust Macro std::arch::is_mips64_feature_detected Macro std::arch::is\_mips64\_feature\_detected ============================================== ``` macro_rules! is_mips64_feature_detected { ("msa") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` 🔬This is a nightly-only experimental API. (`stdsimd` [#27731](https://github.com/rust-lang/rust/issues/27731)) Available on **MIPS-64** only.Checks if `mips64` feature is enabled. rust Macro std::arch::is_powerpc_feature_detected Macro std::arch::is\_powerpc\_feature\_detected =============================================== ``` macro_rules! is_powerpc_feature_detected { ("altivec") => { ... }; ("vsx") => { ... }; ("power8") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` 🔬This is a nightly-only experimental API. (`stdsimd` [#27731](https://github.com/rust-lang/rust/issues/27731)) Available on **PowerPC** only.Checks if `powerpc` feature is enabled. rust Macro std::arch::is_riscv_feature_detected Macro std::arch::is\_riscv\_feature\_detected ============================================= ``` macro_rules! is_riscv_feature_detected { ("rv32i") => { ... }; ("zifencei") => { ... }; ("zihintpause") => { ... }; ("rv64i") => { ... }; ("m") => { ... }; ("a") => { ... }; ("zicsr") => { ... }; ("zicntr") => { ... }; ("zihpm") => { ... }; ("f") => { ... }; ("d") => { ... }; ("q") => { ... }; ("c") => { ... }; ("zfinx") => { ... }; ("zdinx") => { ... }; ("zhinx") => { ... }; ("zhinxmin") => { ... }; ("ztso") => { ... }; ("rv32e") => { ... }; ("rv128i") => { ... }; ("zfh") => { ... }; ("zfhmin") => { ... }; ("b") => { ... }; ("j") => { ... }; ("p") => { ... }; ("v") => { ... }; ("zam") => { ... }; ("s") => { ... }; ("svnapot") => { ... }; ("svpbmt") => { ... }; ("svinval") => { ... }; ("h") => { ... }; ("zba") => { ... }; ("zbb") => { ... }; ("zbc") => { ... }; ("zbs") => { ... }; ("zbkb") => { ... }; ("zbkc") => { ... }; ("zbkx") => { ... }; ("zknd") => { ... }; ("zkne") => { ... }; ("zknh") => { ... }; ("zksed") => { ... }; ("zksh") => { ... }; ("zkr") => { ... }; ("zkn") => { ... }; ("zks") => { ... }; ("zk") => { ... }; ("zkt") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` 🔬This is a nightly-only experimental API. (`stdsimd` [#27731](https://github.com/rust-lang/rust/issues/27731)) Available on **RISC-V RV32 or RISC-V RV64** only.A macro to test at *runtime* whether instruction sets are available on RISC-V platforms. RISC-V standard defined the base sets and the extension sets. The base sets are RV32I, RV64I, RV32E or RV128I. Any RISC-V platform must support one base set and/or multiple extension sets. Any RISC-V standard instruction sets can be in state of either ratified, frozen or draft. The version and status of current standard instruction sets can be checked out from preface section of the [ISA manual](https://github.com/riscv/riscv-isa-manual/). Platform may define and support their own custom instruction sets with ISA prefix X. These sets are highly platform specific and should be detected with their own platform support crates. Unprivileged Specification -------------------------- The supported ratified RISC-V instruction sets are as follows: * RV32I: `"rv32i"` * Zifencei: `"zifencei"` * Zihintpause: `"zihintpause"` * RV64I: `"rv64i"` * M: `"m"` * A: `"a"` * Zicsr: `"zicsr"` * Zicntr: `"zicntr"` * Zihpm: `"zihpm"` * F: `"f"` * D: `"d"` * Q: `"q"` * C: `"c"` There’s also bases and extensions marked as standard instruction set, but they are in frozen or draft state. These instruction sets are also reserved by this macro and can be detected in the future platforms. Frozen RISC-V instruction sets: * Zfinx: `"zfinx"` * Zdinx: `"zdinx"` * Zhinx: `"zhinx"` * Zhinxmin: `"zhinxmin"` * Ztso: `"ztso"` Draft RISC-V instruction sets: * RV32E: `"rv32e"` * RV128I: `"rv128i"` * Zfh: `"zfh"` * Zfhmin: `"zfhmin"` * B: `"b"` * J: `"j"` * P: `"p"` * V: `"v"` * Zam: `"zam"` Defined by Privileged Specification: * Supervisor: `"s"` * Svnapot: `"svnapot"` * Svpbmt: `"svpbmt"` * Svinval: `"svinval"` * Hypervisor: `"h"` RISC-V Bit-Manipulation ISA-extensions -------------------------------------- This document defined the following extensions: * Zba: `"zba"` * Zbb: `"zbb"` * Zbc: `"zbc"` * Zbs: `"zbs"` RISC-V Cryptography Extensions ------------------------------ These extensions are defined in Volume I, Scalar & Entropy Source Instructions: * Zbkb: `"zbkb"` * Zbkc: `"zbkc"` * Zbkx: `"zbkx"` * Zknd: `"zknd"` * Zkne: `"zkne"` * Zknh: `"zknh"` * Zksed: `"zksed"` * Zksh: `"zksh"` * Zkr: `"zkr"` * Zkn: `"zkn"` * Zks: `"zks"` * Zk: `"zk"` * Zkt: `"zkt"` rust Macro std::arch::is_arm_feature_detected Macro std::arch::is\_arm\_feature\_detected =========================================== ``` macro_rules! is_arm_feature_detected { ("neon") => { ... }; ("pmull") => { ... }; ("crc") => { ... }; ("crypto") => { ... }; ("aes") => { ... }; ("sha2") => { ... }; ("i8mm") => { ... }; ("v7") => { ... }; ("vfp2") => { ... }; ("vfp3") => { ... }; ("vfp4") => { ... }; ($t:tt,) => { ... }; ($t:tt) => { ... }; } ``` 🔬This is a nightly-only experimental API. (`stdsimd` [#27731](https://github.com/rust-lang/rust/issues/27731)) Available on **ARM** only.Checks if `arm` feature is enabled. rust Module std::task Module std::task ================ Types and Traits for working with asynchronous tasks. Macros ------ [ready](macro.ready "std::task::ready macro") Extracts the successful type of a [`Poll<T>`](enum.poll). Structs ------- [Ready](struct.ready "std::task::Ready struct")Experimental Extracts the successful type of a [`Poll<T>`](enum.poll "Poll<T>"). [Context](struct.context "std::task::Context struct") The context of an asynchronous task. [RawWaker](struct.rawwaker "std::task::RawWaker struct") A `RawWaker` allows the implementor of a task executor to create a [`Waker`](struct.waker "Waker") which provides customized wakeup behavior. [RawWakerVTable](struct.rawwakervtable "std::task::RawWakerVTable struct") A virtual function pointer table (vtable) that specifies the behavior of a [`RawWaker`](struct.rawwaker "RawWaker"). [Waker](struct.waker "std::task::Waker struct") A `Waker` is a handle for waking up a task by notifying its executor that it is ready to be run. Enums ----- [Poll](enum.poll "std::task::Poll enum") Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead. Traits ------ [Wake](trait.wake "std::task::Wake trait") The implementation of waking a task on an executor. rust Trait std::task::Wake Trait std::task::Wake ===================== ``` pub trait Wake { fn wake(self: Arc<Self>); fn wake_by_ref(self: &Arc<Self>) { ... } } ``` The implementation of waking a task on an executor. This trait can be used to create a [`Waker`](struct.waker "Waker"). An executor can define an implementation of this trait, and use that to construct a Waker to pass to the tasks that are executed on that executor. This trait is a memory-safe and ergonomic alternative to constructing a [`RawWaker`](struct.rawwaker "RawWaker"). It supports the common executor design in which the data used to wake up a task is stored in an [`Arc`](../sync/struct.arc "Arc"). Some executors (especially those for embedded systems) cannot use this API, which is why [`RawWaker`](struct.rawwaker "RawWaker") exists as an alternative for those systems. Examples -------- A basic `block_on` function that takes a future and runs it to completion on the current thread. **Note:** This example trades correctness for simplicity. In order to prevent deadlocks, production-grade implementations will also need to handle intermediate calls to `thread::unpark` as well as nested invocations. ``` use std::future::Future; use std::sync::Arc; use std::task::{Context, Poll, Wake}; use std::thread::{self, Thread}; /// A waker that wakes up the current thread when called. struct ThreadWaker(Thread); impl Wake for ThreadWaker { fn wake(self: Arc<Self>) { self.0.unpark(); } } /// Run a future to completion on the current thread. fn block_on<T>(fut: impl Future<Output = T>) -> T { // Pin the future so it can be polled. let mut fut = Box::pin(fut); // Create a new context to be passed to the future. let t = thread::current(); let waker = Arc::new(ThreadWaker(t)).into(); let mut cx = Context::from_waker(&waker); // Run the future to completion. loop { match fut.as_mut().poll(&mut cx) { Poll::Ready(res) => return res, Poll::Pending => thread::park(), } } } block_on(async { println!("Hi from inside a future!"); }); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/alloc/task.rs.html#73)#### fn wake(self: Arc<Self>) Wake this task. Provided Methods ---------------- [source](https://doc.rust-lang.org/src/alloc/task.rs.html#83)#### fn wake\_by\_ref(self: &Arc<Self>) Wake this task without consuming the waker. If an executor supports a cheaper way to wake without consuming the waker, it should override this method. By default, it clones the [`Arc`](../sync/struct.arc "Arc") and calls [`wake`](trait.wake#tymethod.wake) on the clone. Implementors ------------ rust Struct std::task::RawWakerVTable Struct std::task::RawWakerVTable ================================ ``` pub struct RawWakerVTable { /* private fields */ } ``` A virtual function pointer table (vtable) that specifies the behavior of a [`RawWaker`](struct.rawwaker "RawWaker"). The pointer passed to all functions inside the vtable is the `data` pointer from the enclosing [`RawWaker`](struct.rawwaker "RawWaker") object. The functions inside this struct are only intended to be called on the `data` pointer of a properly constructed [`RawWaker`](struct.rawwaker "RawWaker") object from inside the [`RawWaker`](struct.rawwaker "RawWaker") implementation. Calling one of the contained functions using any other `data` pointer will cause undefined behavior. These functions must all be thread-safe (even though [`RawWaker`](struct.rawwaker "RawWaker") is `![Send](../marker/trait.send "Send") + ![Sync](../marker/trait.sync "Sync")`) because [`Waker`](struct.waker "Waker") is `[Send](../marker/trait.send "Send") + [Sync](../marker/trait.sync "Sync")`, and thus wakers may be moved to arbitrary threads or invoked by `&` reference. For example, this means that if the `clone` and `drop` functions manage a reference count, they must do so atomically. Implementations --------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#115)### impl RawWakerVTable [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#162-167)const: 1.36.0 · #### pub const fn new( clone: unsafe fn(\*const ()) -> RawWaker, wake: unsafe fn(\*const ()), wake\_by\_ref: unsafe fn(\*const ()), drop: unsafe fn(\*const ())) -> RawWakerVTable Creates a new `RawWakerVTable` from the provided `clone`, `wake`, `wake_by_ref`, and `drop` functions. These functions must all be thread-safe (even though [`RawWaker`](struct.rawwaker "RawWaker") is `![Send](../marker/trait.send "Send") + ![Sync](../marker/trait.sync "Sync")`) because [`Waker`](struct.waker "Waker") is `[Send](../marker/trait.send "Send") + [Sync](../marker/trait.sync "Sync")`, and thus wakers may be moved to arbitrary threads or invoked by `&` reference. For example, this means that if the `clone` and `drop` functions manage a reference count, they must do so atomically. ##### `clone` This function will be called when the [`RawWaker`](struct.rawwaker "RawWaker") gets cloned, e.g. when the [`Waker`](struct.waker "Waker") in which the [`RawWaker`](struct.rawwaker "RawWaker") is stored gets cloned. The implementation of this function must retain all resources that are required for this additional instance of a [`RawWaker`](struct.rawwaker "RawWaker") and associated task. Calling `wake` on the resulting [`RawWaker`](struct.rawwaker "RawWaker") should result in a wakeup of the same task that would have been awoken by the original [`RawWaker`](struct.rawwaker "RawWaker"). ##### `wake` This function will be called when `wake` is called on the [`Waker`](struct.waker "Waker"). It must wake up the task associated with this [`RawWaker`](struct.rawwaker "RawWaker"). The implementation of this function must make sure to release any resources that are associated with this instance of a [`RawWaker`](struct.rawwaker "RawWaker") and associated task. ##### `wake_by_ref` This function will be called when `wake_by_ref` is called on the [`Waker`](struct.waker "Waker"). It must wake up the task associated with this [`RawWaker`](struct.rawwaker "RawWaker"). This function is similar to `wake`, but must not consume the provided data pointer. ##### `drop` This function gets called when a [`RawWaker`](struct.rawwaker "RawWaker") gets dropped. The implementation of this function must make sure to release any resources that are associated with this instance of a [`RawWaker`](struct.rawwaker "RawWaker") and associated task. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)### impl Clone for RawWakerVTable [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)#### fn clone(&self) -> RawWakerVTable Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)### impl Debug for RawWakerVTable [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)### impl PartialEq<RawWakerVTable> for RawWakerVTable [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)#### fn eq(&self, other: &RawWakerVTable) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)### impl Copy for RawWakerVTable [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)### impl StructuralPartialEq for RawWakerVTable Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for RawWakerVTable ### impl Send for RawWakerVTable ### impl Sync for RawWakerVTable ### impl Unpin for RawWakerVTable ### impl UnwindSafe for RawWakerVTable Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::task::Waker Struct std::task::Waker ======================= ``` #[repr(transparent)]pub struct Waker { /* private fields */ } ``` A `Waker` is a handle for waking up a task by notifying its executor that it is ready to be run. This handle encapsulates a [`RawWaker`](struct.rawwaker "RawWaker") instance, which defines the executor-specific wakeup behavior. The typical life of a `Waker` is that it is constructed by an executor, wrapped in a [`Context`](struct.context "Context"), then passed to [`Future::poll()`](../future/trait.future#tymethod.poll). Then, if the future chooses to return [`Poll::Pending`](enum.poll#variant.Pending), it must also store the waker somehow and call [`Waker::wake()`](struct.waker#method.wake "Waker::wake()") when the future should be polled again. Implements [`Clone`](../clone/trait.clone "Clone"), [`Send`](../marker/trait.send "Send"), and [`Sync`](../marker/trait.sync "Sync"); therefore, a waker may be invoked from any thread, including ones not in any way managed by the executor. For example, this might be done to wake a future when a blocking function call completes on another thread. Implementations --------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#242)### impl Waker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#262)#### pub fn wake(self) Wake up the task associated with this `Waker`. As long as the executor keeps running and the task is not finished, it is guaranteed that each invocation of [`wake()`](struct.waker#method.wake) (or [`wake_by_ref()`](struct.waker#method.wake_by_ref)) will be followed by at least one [`poll()`](../future/trait.future#tymethod.poll) of the task to which this `Waker` belongs. This makes it possible to temporarily yield to other tasks while running potentially unbounded processing loops. Note that the above implies that multiple wake-ups may be coalesced into a single [`poll()`](../future/trait.future#tymethod.poll) invocation by the runtime. Also note that yielding to competing tasks is not guaranteed: it is the executor’s choice which task to run and the executor may choose to run the current task again. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#284)#### pub fn wake\_by\_ref(&self) Wake up the task associated with this `Waker` without consuming the `Waker`. This is similar to [`wake()`](struct.waker#method.wake), but may be slightly less efficient in the case where an owned `Waker` is available. This method should be preferred to calling `waker.clone().wake()`. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#302)#### pub fn will\_wake(&self, other: &Waker) -> bool Returns `true` if this `Waker` and another `Waker` would awake the same task. This function works on a best-effort basis, and may return false even when the `Waker`s would awaken the same task. However, if this function returns `true`, it is guaranteed that the `Waker`s will awaken the same task. This function is primarily used for optimization purposes. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#314)#### pub unsafe fn from\_raw(waker: RawWaker) -> Waker Creates a new `Waker` from [`RawWaker`](struct.rawwaker "RawWaker"). The behavior of the returned `Waker` is undefined if the contract defined in [`RawWaker`](struct.rawwaker "RawWaker")’s and [`RawWakerVTable`](struct.rawwakervtable "RawWakerVTable")’s documentation is not upheld. Therefore this method is unsafe. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#322)#### pub fn as\_raw(&self) -> &RawWaker 🔬This is a nightly-only experimental API. (`waker_getters` [#87021](https://github.com/rust-lang/rust/issues/87021)) Get a reference to the underlying [`RawWaker`](struct.rawwaker "RawWaker"). Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#328)### impl Clone for Waker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#330)#### fn clone(&self) -> Waker Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#352)### impl Debug for Waker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#353)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#341)### impl Drop for Waker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#343)#### fn drop(&mut self) Executes the destructor for this type. [Read more](../ops/trait.drop#tymethod.drop) [source](https://doc.rust-lang.org/src/alloc/task.rs.html#89)1.51.0 · ### impl<W> From<Arc<W>> for Wakerwhere W: 'static + [Wake](trait.wake "trait std::task::Wake") + [Send](../marker/trait.send "trait std::marker::Send") + [Sync](../marker/trait.sync "trait std::marker::Sync"), [source](https://doc.rust-lang.org/src/alloc/task.rs.html#93)#### fn from(waker: Arc<W>) -> Waker Use a `Wake`-able type as a `Waker`. No heap allocations or atomic operations are used for this conversion. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#238)### impl Send for Waker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#240)### impl Sync for Waker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#236)### impl Unpin for Waker Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for Waker ### impl UnwindSafe for Waker Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Macro std::task::ready Macro std::task::ready ====================== ``` pub macro ready($e:expr) { ... } ``` Extracts the successful type of a [`Poll<T>`](enum.poll). This macro bakes in propagation of [`Pending`](enum.poll#variant.Pending) signals by returning early. Examples -------- ``` use std::task::{ready, Context, Poll}; use std::future::{self, Future}; use std::pin::Pin; pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> { let mut fut = future::ready(42); let fut = Pin::new(&mut fut); let num = ready!(fut.poll(cx)); // ... use num Poll::Ready(()) } ``` The `ready!` call expands to: ``` let num = match fut.poll(cx) { Poll::Ready(t) => t, Poll::Pending => return Poll::Pending, }; ``` rust Struct std::task::Ready Struct std::task::Ready ======================= ``` pub struct Ready<T>(_); ``` 🔬This is a nightly-only experimental API. (`poll_ready` [#89780](https://github.com/rust-lang/rust/issues/89780)) Extracts the successful type of a [`Poll<T>`](enum.poll "Poll<T>"). See [`Poll::ready`](enum.poll#method.ready "Poll::ready") for details. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#110)### impl<T> Debug for Ready<T> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#111)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#90)### impl<T> FromResidual<<Ready<T> as Try>::Residual> for Ready<T> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#92)#### fn from\_residual(residual: Ready<Infallible>) -> Ready<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#100)### impl<T> FromResidual<Ready<Infallible>> for Poll<T> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#102)#### fn from\_residual(residual: Ready<Infallible>) -> Poll<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#71)### impl<T> Try for Ready<T> #### type Output = T 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value produced by `?` when *not* short-circuiting. #### type Residual = Ready<Infallible> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value passed to [`FromResidual::from_residual`](../ops/trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") as part of `?` when short-circuiting. [Read more](../ops/trait.try#associatedtype.Residual) [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#76)#### fn from\_output(output: <Ready<T> as Try>::Output) -> Ready<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from its `Output` type. [Read more](../ops/trait.try#tymethod.from_output) [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#81)#### fn branch( self) -> ControlFlow<<Ready<T> as Try>::Residual, <Ready<T> as Try>::Output> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used in `?` to decide whether the operator should produce a value (because this returned [`ControlFlow::Continue`](../ops/enum.controlflow#variant.Continue "ControlFlow::Continue")) or propagate a value back to the caller (because this returned [`ControlFlow::Break`](../ops/enum.controlflow#variant.Break "ControlFlow::Break")). [Read more](../ops/trait.try#tymethod.branch) Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Ready<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Ready<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Ready<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Ready<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Ready<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::task::Context Struct std::task::Context ========================= ``` pub struct Context<'a> { /* private fields */ } ``` The context of an asynchronous task. Currently, `Context` only serves to provide access to a [`&Waker`](struct.waker) which can be used to wake the current task. Implementations --------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#186)### impl<'a> Context<'a> [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#191)#### pub fn from\_waker(waker: &'a Waker) -> Context<'a> Create a new `Context` from a [`&Waker`](struct.waker). [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#199)#### pub fn waker(&self) -> &'a Waker Returns a reference to the [`Waker`](struct.waker "Waker") for the current task. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#205)### impl Debug for Context<'\_> [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#206)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) Auto Trait Implementations -------------------------- ### impl<'a> RefUnwindSafe for Context<'a> ### impl<'a> Send for Context<'a> ### impl<'a> Sync for Context<'a> ### impl<'a> Unpin for Context<'a> ### impl<'a> UnwindSafe for Context<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::task::RawWaker Struct std::task::RawWaker ========================== ``` pub struct RawWaker { /* private fields */ } ``` A `RawWaker` allows the implementor of a task executor to create a [`Waker`](struct.waker "Waker") which provides customized wakeup behavior. It consists of a data pointer and a [virtual function pointer table (vtable)](https://en.wikipedia.org/wiki/Virtual_method_table) that customizes the behavior of the `RawWaker`. Implementations --------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#26)### impl RawWaker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#43)const: 1.36.0 · #### pub const fn new(data: \*const (), vtable: &'static RawWakerVTable) -> RawWaker Creates a new `RawWaker` from the provided `data` pointer and `vtable`. The `data` pointer can be used to store arbitrary data as required by the executor. This could be e.g. a type-erased pointer to an `Arc` that is associated with the task. The value of this pointer will get passed to all functions that are part of the `vtable` as the first parameter. The `vtable` customizes the behavior of a `Waker` which gets created from a `RawWaker`. For each operation on the `Waker`, the associated function in the `vtable` of the underlying `RawWaker` will be called. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#51)#### pub fn data(&self) -> \*const () 🔬This is a nightly-only experimental API. (`waker_getters` [#87021](https://github.com/rust-lang/rust/issues/87021)) Get the `data` pointer used to create this `RawWaker`. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#59)#### pub fn vtable(&self) -> &'static RawWakerVTable 🔬This is a nightly-only experimental API. (`waker_getters` [#87021](https://github.com/rust-lang/rust/issues/87021)) Get the `vtable` pointer used to create this `RawWaker`. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#13)### impl Debug for RawWaker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#13)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/alloc/task.rs.html#101)1.51.0 · ### impl<W> From<Arc<W>> for RawWakerwhere W: 'static + [Wake](trait.wake "trait std::task::Wake") + [Send](../marker/trait.send "trait std::marker::Send") + [Sync](../marker/trait.sync "trait std::marker::Sync"), [source](https://doc.rust-lang.org/src/alloc/task.rs.html#105)#### fn from(waker: Arc<W>) -> RawWaker Use a `Wake`-able type as a `RawWaker`. No heap allocations or atomic operations are used for this conversion. [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#13)### impl PartialEq<RawWaker> for RawWaker [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#13)#### fn eq(&self, other: &RawWaker) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#13)### impl StructuralPartialEq for RawWaker Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for RawWaker ### impl !Send for RawWaker ### impl !Sync for RawWaker ### impl Unpin for RawWaker ### impl UnwindSafe for RawWaker Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Enum std::task::Poll Enum std::task::Poll ==================== ``` pub enum Poll<T> { Ready(T), Pending, } ``` Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead. Variants -------- ### `Ready(T)` Represents that a value is immediately ready. ### `Pending` Represents that a value is not ready yet. When a function returns `Pending`, the function *must* also ensure that the current task is scheduled to be awoken when progress can be made. Implementations --------------- [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#29)### impl<T> Poll<T> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#47-49)#### pub fn map<U, F>(self, f: F) -> Poll<U>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U, Maps a `Poll<T>` to `Poll<U>` by applying a function to a contained value. ##### Examples Converts a `Poll<[String](../string/struct.string "String")>` into a `Poll<[usize](../primitive.usize "usize")>`, consuming the original: ``` let poll_some_string = Poll::Ready(String::from("Hello, World!")); // `Poll::map` takes self *by value*, consuming `poll_some_string` let poll_some_len = poll_some_string.map(|s| s.len()); assert_eq!(poll_some_len, Poll::Ready(13)); ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#72)const: 1.49.0 · #### pub const fn is\_ready(&self) -> bool Returns `true` if the poll is a [`Poll::Ready`](enum.poll#variant.Ready "Poll::Ready") value. ##### Examples ``` let x: Poll<u32> = Poll::Ready(2); assert_eq!(x.is_ready(), true); let x: Poll<u32> = Poll::Pending; assert_eq!(x.is_ready(), false); ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#93)const: 1.49.0 · #### pub const fn is\_pending(&self) -> bool Returns `true` if the poll is a [`Pending`](enum.poll#variant.Pending) value. ##### Examples ``` let x: Poll<u32> = Poll::Ready(2); assert_eq!(x.is_pending(), false); let x: Poll<u32> = Poll::Pending; assert_eq!(x.is_pending(), true); ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#125)#### pub fn ready(self) -> Ready<T> 🔬This is a nightly-only experimental API. (`poll_ready` [#89780](https://github.com/rust-lang/rust/issues/89780)) Extracts the successful type of a [`Poll<T>`](enum.poll "Poll<T>"). When combined with the `?` operator, this function will propagate any [`Poll::Pending`](enum.poll#variant.Pending "Poll::Pending") values to the caller, and extract the `T` from [`Poll::Ready`](enum.poll#variant.Ready "Poll::Ready"). ##### Examples ``` #![feature(poll_ready)] use std::task::{Context, Poll}; use std::future::{self, Future}; use std::pin::Pin; pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> { let mut fut = future::ready(42); let fut = Pin::new(&mut fut); let num = fut.poll(cx).ready()?; // ... use num Poll::Ready(()) } ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#130)### impl<T, E> Poll<Result<T, E>> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#146-148)#### pub fn map\_ok<U, F>(self, f: F) -> Poll<Result<U, E>>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U, Maps a `Poll<Result<T, E>>` to `Poll<Result<U, E>>` by applying a function to a contained `Poll::Ready(Ok)` value, leaving all other variants untouched. This function can be used to compose the results of two functions. ##### Examples ``` let res: Poll<Result<u8, _>> = Poll::Ready("12".parse()); let squared = res.map_ok(|n| n * n); assert_eq!(squared, Poll::Ready(Ok(144))); ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#173-175)#### pub fn map\_err<U, F>(self, f: F) -> Poll<Result<T, U>>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(E) -> U, Maps a `Poll::Ready<Result<T, E>>` to `Poll::Ready<Result<T, F>>` by applying a function to a contained `Poll::Ready(Err)` value, leaving all other variants untouched. This function can be used to pass through a successful result while handling an error. ##### Examples ``` let res: Poll<Result<u8, _>> = Poll::Ready("oops".parse()); let res = res.map_err(|_| 0_u8); assert_eq!(res, Poll::Ready(Err(0))); ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#185)### impl<T, E> Poll<Option<Result<T, E>>> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#201-203)1.51.0 · #### pub fn map\_ok<U, F>(self, f: F) -> Poll<Option<Result<U, E>>>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U, Maps a `Poll<Option<Result<T, E>>>` to `Poll<Option<Result<U, E>>>` by applying a function to a contained `Poll::Ready(Some(Ok))` value, leaving all other variants untouched. This function can be used to compose the results of two functions. ##### Examples ``` let res: Poll<Option<Result<u8, _>>> = Poll::Ready(Some("12".parse())); let squared = res.map_ok(|n| n * n); assert_eq!(squared, Poll::Ready(Some(Ok(144)))); ``` [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#230-232)1.51.0 · #### pub fn map\_err<U, F>(self, f: F) -> Poll<Option<Result<T, U>>>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(E) -> U, Maps a `Poll::Ready<Option<Result<T, E>>>` to `Poll::Ready<Option<Result<T, F>>>` by applying a function to a contained `Poll::Ready(Some(Err))` value, leaving all other variants untouched. This function can be used to pass through a successful result while handling an error. ##### Examples ``` let res: Poll<Option<Result<u8, _>>> = Poll::Ready(Some("oops".parse())); let res = res.map_err(|_| 0_u8); assert_eq!(res, Poll::Ready(Some(Err(0)))); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> Clone for Poll<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)#### fn clone(&self) -> Poll<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> Debug for Poll<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#245)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> From<T> for Poll<T> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#254)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> Poll<T> Moves the value into a [`Poll::Ready`](enum.poll#variant.Ready "Poll::Ready") to make a `Poll<T>`. ##### Example ``` assert_eq!(Poll::from(true), Poll::Ready(true)); ``` [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#100)### impl<T> FromResidual<Ready<Infallible>> for Poll<T> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#102)#### fn from\_residual(residual: Ready<Infallible>) -> Poll<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#311-312)### impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Option<Result<T, F>>>where F: [From](../convert/trait.from "trait std::convert::From")<E>, [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#315)#### fn from\_residual(x: Result<Infallible, E>) -> Poll<Option<Result<T, F>>> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#280)### impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Result<T, F>>where F: [From](../convert/trait.from "trait std::convert::From")<E>, [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#282)#### fn from\_residual(x: Result<Infallible, E>) -> Poll<Result<T, F>> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](../ops/trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> Hash for Poll<T>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> Ord for Poll<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)#### fn cmp(&self, other: &Poll<T>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> PartialEq<Poll<T>> for Poll<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)#### fn eq(&self, other: &Poll<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> PartialOrd<Poll<T>> for Poll<T>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)#### fn partial\_cmp(&self, other: &Poll<T>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#290)### impl<T, E> Try for Poll<Option<Result<T, E>>> #### type Output = Poll<Option<T>> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value produced by `?` when *not* short-circuiting. #### type Residual = Result<Infallible, E> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value passed to [`FromResidual::from_residual`](../ops/trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") as part of `?` when short-circuiting. [Read more](../ops/trait.try#associatedtype.Residual) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#295)#### fn from\_output( c: <Poll<Option<Result<T, E>>> as Try>::Output) -> Poll<Option<Result<T, E>>> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from its `Output` type. [Read more](../ops/trait.try#tymethod.from_output) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#300)#### fn branch( self) -> ControlFlow<<Poll<Option<Result<T, E>>> as Try>::Residual, <Poll<Option<Result<T, E>>> as Try>::Output> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used in `?` to decide whether the operator should produce a value (because this returned [`ControlFlow::Continue`](../ops/enum.controlflow#variant.Continue "ControlFlow::Continue")) or propagate a value back to the caller (because this returned [`ControlFlow::Break`](../ops/enum.controlflow#variant.Break "ControlFlow::Break")). [Read more](../ops/trait.try#tymethod.branch) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#260)### impl<T, E> Try for Poll<Result<T, E>> #### type Output = Poll<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value produced by `?` when *not* short-circuiting. #### type Residual = Result<Infallible, E> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value passed to [`FromResidual::from_residual`](../ops/trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") as part of `?` when short-circuiting. [Read more](../ops/trait.try#associatedtype.Residual) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#265)#### fn from\_output(c: <Poll<Result<T, E>> as Try>::Output) -> Poll<Result<T, E>> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from its `Output` type. [Read more](../ops/trait.try#tymethod.from_output) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#270)#### fn branch( self) -> ControlFlow<<Poll<Result<T, E>> as Try>::Residual, <Poll<Result<T, E>> as Try>::Output> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used in `?` to decide whether the operator should produce a value (because this returned [`ControlFlow::Continue`](../ops/enum.controlflow#variant.Continue "ControlFlow::Continue")) or propagate a value back to the caller (because this returned [`ControlFlow::Break`](../ops/enum.controlflow#variant.Break "ControlFlow::Break")). [Read more](../ops/trait.try#tymethod.branch) [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> Copy for Poll<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> Eq for Poll<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> StructuralEq for Poll<T> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)### impl<T> StructuralPartialEq for Poll<T> Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Poll<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Poll<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Poll<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Poll<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Poll<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#577)### impl<T> From<!> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: !) -> T Converts to this type from the input type. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Module std::lazy Module std::lazy ================ 🔬This is a nightly-only experimental API. (`once_cell` [#74465](https://github.com/rust-lang/rust/issues/74465)) Lazy values and one-time initialization of static data. rust Module std::i32 Module std::i32 =============== 👎Deprecating in a future Rust version: all constants in this module replaced by associated constants on `i32` Constants for the 32-bit signed integer type. *[See also the `i32` primitive type](../primitive.i32 "i32").* New code should use the associated constants directly on the primitive type. Constants --------- [MAX](constant.max "std::i32::MAX constant")Deprecation planned The largest value that can be represented by this integer type. Use [`i32::MAX`](../primitive.i32#associatedconstant.MAX "i32::MAX") instead. [MIN](constant.min "std::i32::MIN constant")Deprecation planned The smallest value that can be represented by this integer type. Use [`i32::MIN`](../primitive.i32#associatedconstant.MIN "i32::MIN") instead. rust Constant std::i32::MAX Constant std::i32::MAX ====================== ``` pub const MAX: i32 = i32::MAX; // 2_147_483_647i32 ``` 👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type The largest value that can be represented by this integer type. Use [`i32::MAX`](../primitive.i32#associatedconstant.MAX "i32::MAX") instead. Examples -------- ``` // deprecated way let max = std::i32::MAX; // intended way let max = i32::MAX; ``` rust Constant std::i32::MIN Constant std::i32::MIN ====================== ``` pub const MIN: i32 = i32::MIN; // -2_147_483_648i32 ``` 👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type The smallest value that can be represented by this integer type. Use [`i32::MIN`](../primitive.i32#associatedconstant.MIN "i32::MIN") instead. Examples -------- ``` // deprecated way let min = std::i32::MIN; // intended way let min = i32::MIN; ``` rust Trait std::ops::Deref Trait std::ops::Deref ===================== ``` pub trait Deref { type Target: ?Sized; fn deref(&self) -> &Self::Target; } ``` Used for immutable dereferencing operations, like `*v`. In addition to being used for explicit dereferencing operations with the (unary) `*` operator in immutable contexts, `Deref` is also used implicitly by the compiler in many circumstances. This mechanism is called [‘`Deref` coercion’](#more-on-deref-coercion). In mutable contexts, [`DerefMut`](trait.derefmut "DerefMut") is used. Implementing `Deref` for smart pointers makes accessing the data behind them convenient, which is why they implement `Deref`. On the other hand, the rules regarding `Deref` and [`DerefMut`](trait.derefmut "DerefMut") were designed specifically to accommodate smart pointers. Because of this, **`Deref` should only be implemented for smart pointers** to avoid confusion. For similar reasons, **this trait should never fail**. Failure during dereferencing can be extremely confusing when `Deref` is invoked implicitly. More on `Deref` coercion ------------------------ If `T` implements `Deref<Target = U>`, and `x` is a value of type `T`, then: * In immutable contexts, `*x` (where `T` is neither a reference nor a raw pointer) is equivalent to `*Deref::deref(&x)`. * Values of type `&T` are coerced to values of type `&U` * `T` implicitly implements all the (immutable) methods of the type `U`. For more details, visit [the chapter in *The Rust Programming Language*](../../book/ch15-02-deref) as well as the reference sections on [the dereference operator](../../reference/expressions/operator-expr#the-dereference-operator), [method resolution](../../reference/expressions/method-call-expr) and [type coercions](../../reference/type-coercions). Examples -------- A struct with a single field which is accessible by dereferencing the struct. ``` use std::ops::Deref; struct DerefExample<T> { value: T } impl<T> Deref for DerefExample<T> { type Target = T; fn deref(&self) -> &Self::Target { &self.value } } let x = DerefExample { value: 'a' }; assert_eq!('a', *x); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#69)#### type Target: ?Sized The resulting type after dereferencing. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#75)#### fn deref(&self) -> &Self::Target Dereferences the value. Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#709)### impl Deref for CString #### type Target = CStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#510-517)### impl Deref for OsString #### type Target = OsStr [source](https://doc.rust-lang.org/src/std/path.rs.html#1719-1725)### impl Deref for PathBuf #### type Target = Path [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2429)### impl Deref for String #### type Target = str [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1323-1330)1.36.0 · ### impl<'a> Deref for IoSlice<'a> #### type Target = [u8] [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1180-1187)1.36.0 · ### impl<'a> Deref for IoSliceMut<'a> #### type Target = [u8] [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#428)### impl<'a, 'f> Deref for VaList<'a, 'f>where 'f: 'a, #### type Target = VaListImpl<'f> [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#333)const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref") · ### impl<B> Deref for Cow<'\_, B>where B: [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), <B as [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned")>::[Owned](../borrow/trait.toowned#associatedtype.Owned "type std::borrow::ToOwned::Owned"): [Borrow](../borrow/trait.borrow "trait std::borrow::Borrow")<B>, #### type Target = B [source](https://doc.rust-lang.org/src/core/pin.rs.html#871)1.33.0 · ### impl<P> Deref for Pin<P>where P: [Deref](trait.deref "trait std::ops::Deref"), #### type Target = <P as Deref>::Target [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#80)const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref") · ### impl<T> Deref for &Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#94)const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref") · ### impl<T> Deref for &mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#110)### impl<T> Deref for ThinBox<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/core/cell.rs.html#1335)### impl<T> Deref for Ref<'\_, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/core/cell.rs.html#1717)### impl<T> Deref for RefMut<'\_, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#303)1.12.0 · ### impl<T> Deref for PeekMut<'\_, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), #### type Target = T [source](https://doc.rust-lang.org/src/core/mem/manually_drop.rs.html#150)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref")) · ### impl<T> Deref for ManuallyDrop<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#251)1.9.0 · ### impl<T> Deref for AssertUnwindSafe<T> #### type Target = T [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1515)### impl<T> Deref for Rc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#1376)### impl<T> Deref for Arc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1851)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · ### impl<T, A> Deref for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Target = T [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2528)### impl<T, A> Deref for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Target = [T] [source](https://doc.rust-lang.org/src/core/cell/lazy.rs.html#84)### impl<T, F> Deref for LazyCell<T, F>where F: [FnOnce](trait.fnonce "trait std::ops::FnOnce")() -> T, #### type Target = T [source](https://doc.rust-lang.org/src/std/sync/lazy_lock.rs.html#84-89)### impl<T, F: FnOnce() -> T> Deref for LazyLock<T, F> #### type Target = T [source](https://doc.rust-lang.org/src/std/sync/mutex.rs.html#508-514)### impl<T: ?Sized> Deref for MutexGuard<'\_, T> #### type Target = T [source](https://doc.rust-lang.org/src/std/sync/rwlock.rs.html#571-578)### impl<T: ?Sized> Deref for RwLockReadGuard<'\_, T> #### type Target = T [source](https://doc.rust-lang.org/src/std/sync/rwlock.rs.html#581-588)### impl<T: ?Sized> Deref for RwLockWriteGuard<'\_, T> #### type Target = T rust Trait std::ops::Residual Trait std::ops::Residual ======================== ``` pub trait Residual<O> { type TryType: Try    where        <Self::TryType as Try>::Output == O,        <Self::TryType as Try>::Residual == Self; } ``` 🔬This is a nightly-only experimental API. (`try_trait_v2_residual` [#91285](https://github.com/rust-lang/rust/issues/91285)) Allows retrieving the canonical type implementing [`Try`](trait.try "Try") that has this type as its residual and allows it to hold an `O` as its output. If you think of the `Try` trait as splitting a type into its [`Try::Output`](trait.try#associatedtype.Output "Try::Output") and [`Try::Residual`](trait.try#associatedtype.Residual "Try::Residual") components, this allows putting them back together. For example, `Result<T, E>: Try<Output = T, Residual = Result<Infallible, E>>`, and in the other direction, `<Result<Infallible, E> as Residual<T>>::TryType = Result<T, E>`. Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#442)#### type TryType: Trywhere <Self::[TryType](trait.residual#associatedtype.TryType "type std::ops::Residual::TryType") as [Try](trait.try "trait std::ops::Try")>::[Output](trait.try#associatedtype.Output "type std::ops::Try::Output") == O, <Self::[TryType](trait.residual#associatedtype.TryType "type std::ops::Residual::TryType") as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual") == Self 🔬This is a nightly-only experimental API. (`try_trait_v2_residual` [#91285](https://github.com/rust-lang/rust/issues/91285)) The “return” type of this meta-function. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#127)### impl<B, C> Residual<C> for ControlFlow<B, Infallible> #### type TryType = ControlFlow<B, C> [source](https://doc.rust-lang.org/src/core/option.rs.html#2324)### impl<T> Residual<T> for Option<Infallible> #### type TryType = Option<T> [source](https://doc.rust-lang.org/src/core/result.rs.html#2119)### impl<T, E> Residual<T> for Result<Infallible, E> #### type TryType = Result<T, E> rust Trait std::ops::Sub Trait std::ops::Sub =================== ``` pub trait Sub<Rhs = Self> { type Output; fn sub(self, rhs: Rhs) -> Self::Output; } ``` The subtraction operator `-`. Note that `Rhs` is `Self` by default, but this is not mandatory. For example, [`std::time::SystemTime`](../time/struct.systemtime) implements `Sub<Duration>`, which permits operations of the form `SystemTime = SystemTime - Duration`. Examples -------- ### `Sub`tractable points ``` use std::ops::Sub; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl Sub for Point { type Output = Self; fn sub(self, other: Self) -> Self::Output { Self { x: self.x - other.x, y: self.y - other.y, } } } assert_eq!(Point { x: 3, y: 3 } - Point { x: 2, y: 3 }, Point { x: 1, y: 0 }); ``` ### Implementing `Sub` with generics Here is an example of the same `Point` struct implementing the `Sub` trait using generics. ``` use std::ops::Sub; #[derive(Debug, PartialEq)] struct Point<T> { x: T, y: T, } // Notice that the implementation uses the associated type `Output`. impl<T: Sub<Output = T>> Sub for Point<T> { type Output = Self; fn sub(self, other: Self) -> Self::Output { Point { x: self.x - other.x, y: self.y - other.y, } } } assert_eq!(Point { x: 2, y: 3 } - Point { x: 1, y: 0 }, Point { x: 1, y: 3 }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#210)#### type Output The resulting type after applying the `-` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#221)#### fn sub(self, rhs: Rhs) -> Self::Output Performs the `-` operation. ##### Example ``` assert_eq!(12 - 1, 11); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&f32> for &f32 #### type Output = <f32 as Sub<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&f32> for f32 #### type Output = <f32 as Sub<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&f64> for &f64 #### type Output = <f64 as Sub<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&f64> for f64 #### type Output = <f64 as Sub<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i8> for &i8 #### type Output = <i8 as Sub<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i8> for i8 #### type Output = <i8 as Sub<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i16> for &i16 #### type Output = <i16 as Sub<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i16> for i16 #### type Output = <i16 as Sub<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i32> for &i32 #### type Output = <i32 as Sub<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i32> for i32 #### type Output = <i32 as Sub<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i64> for &i64 #### type Output = <i64 as Sub<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i64> for i64 #### type Output = <i64 as Sub<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i128> for &i128 #### type Output = <i128 as Sub<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&i128> for i128 #### type Output = <i128 as Sub<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&isize> for &isize #### type Output = <isize as Sub<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&isize> for isize #### type Output = <isize as Sub<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u8> for &u8 #### type Output = <u8 as Sub<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u8> for u8 #### type Output = <u8 as Sub<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u16> for &u16 #### type Output = <u16 as Sub<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u16> for u16 #### type Output = <u16 as Sub<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u32> for &u32 #### type Output = <u32 as Sub<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u32> for u32 #### type Output = <u32 as Sub<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u64> for &u64 #### type Output = <u64 as Sub<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u64> for u64 #### type Output = <u64 as Sub<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u128> for &u128 #### type Output = <u128 as Sub<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&u128> for u128 #### type Output = <u128 as Sub<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&usize> for &usize #### type Output = <usize as Sub<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<&usize> for usize #### type Output = <usize as Sub<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Sub<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Sub<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Sub<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Sub<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Sub<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Sub<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Sub<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Sub<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Sub<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Sub<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Sub<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Sub<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Sub<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Sub<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Sub<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Sub<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Sub<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Sub<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Sub<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Sub<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Sub<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Sub<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Sub<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Sub<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<f32> for f32 #### type Output = f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<f64> for f64 #### type Output = f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/mem/transmutability.rs.html#101)const: [unstable](https://github.com/rust-lang/rust/issues/99571 "Tracking issue for transmutability") · ### impl Sub<Assume> for Assume #### type Output = Assume [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Sub<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Sub<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/time.rs.html#926)1.3.0 · ### impl Sub<Duration> for Duration #### type Output = Duration [source](https://doc.rust-lang.org/src/std/time.rs.html#420-426)1.8.0 · ### impl Sub<Duration> for Instant #### type Output = Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#596-602)1.8.0 · ### impl Sub<Duration> for SystemTime #### type Output = SystemTime [source](https://doc.rust-lang.org/src/std/time.rs.html#436-452)1.8.0 · ### impl Sub<Instant> for Instant #### type Output = Duration [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<f32> for &'a f32 #### type Output = <f32 as Sub<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<f64> for &'a f64 #### type Output = <f64 as Sub<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<i8> for &'a i8 #### type Output = <i8 as Sub<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<i16> for &'a i16 #### type Output = <i16 as Sub<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<i32> for &'a i32 #### type Output = <i32 as Sub<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<i64> for &'a i64 #### type Output = <i64 as Sub<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<i128> for &'a i128 #### type Output = <i128 as Sub<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<isize> for &'a isize #### type Output = <isize as Sub<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<u8> for &'a u8 #### type Output = <u8 as Sub<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<u16> for &'a u16 #### type Output = <u16 as Sub<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<u32> for &'a u32 #### type Output = <u32 as Sub<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<u64> for &'a u64 #### type Output = <u64 as Sub<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<u128> for &'a u128 #### type Output = <u128 as Sub<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Sub<usize> for &'a usize #### type Output = <usize as Sub<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Sub<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Sub<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Sub<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Sub<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Sub<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Sub<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Sub<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Sub<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Sub<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Sub<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Sub<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Sub<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Sub<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Sub<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Sub<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Sub<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Sub<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Sub<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Sub<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Sub<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Sub<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Sub<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Sub<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Sub<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Sub<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Sub<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Sub<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](trait.sub "trait std::ops::Sub")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](trait.sub "trait std::ops::Sub")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1379)### impl<T, A> Sub<&BTreeSet<T, A>> for &BTreeSet<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Output = BTreeSet<T, A> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1222-1252)### impl<T, S> Sub<&HashSet<T, S>> for &HashSet<T, S>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Clone](../clone/trait.clone "trait std::clone::Clone"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher") + [Default](../default/trait.default "trait std::default::Default"), #### type Output = HashSet<T, S> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Sub<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](trait.sub "trait std::ops::Sub")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](trait.sub "trait std::ops::Sub")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Sub<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](trait.sub "trait std::ops::Sub")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](trait.sub "trait std::ops::Sub")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Sub<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Sub<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Sub<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Enum std::ops::GeneratorState Enum std::ops::GeneratorState ============================= ``` pub enum GeneratorState<Y, R> { Yielded(Y), Complete(R), } ``` 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The result of a generator resumption. This enum is returned from the `Generator::resume` method and indicates the possible return values of a generator. Currently this corresponds to either a suspension point (`Yielded`) or a termination point (`Complete`). Variants -------- ### `Yielded(Y)` 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The generator suspended with a value. This state indicates that a generator has been suspended, and typically corresponds to a `yield` statement. The value provided in this variant corresponds to the expression passed to `yield` and allows generators to provide a value each time they yield. ### `Complete(R)` 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The generator completed with a return value. This state indicates that a generator has finished execution with the provided value. Once a generator has returned `Complete` it is considered a programmer error to call `resume` again. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Clone for GeneratorState<Y, R>where Y: [Clone](../clone/trait.clone "trait std::clone::Clone"), R: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)#### fn clone(&self) -> GeneratorState<Y, R> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Debug for GeneratorState<Y, R>where Y: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), R: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Hash for GeneratorState<Y, R>where Y: [Hash](../hash/trait.hash "trait std::hash::Hash"), R: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Ord for GeneratorState<Y, R>where Y: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), R: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)#### fn cmp(&self, other: &GeneratorState<Y, R>) -> Ordering This method returns an [`Ordering`](../cmp/enum.ordering "Ordering") between `self` and `other`. [Read more](../cmp/trait.ord#tymethod.cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#804-807)1.21.0 · #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. [Read more](../cmp/trait.ord#method.max) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#831-834)1.21.0 · #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. [Read more](../cmp/trait.ord#method.min) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#863-867)1.50.0 · #### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self>, Restrict a value to a certain interval. [Read more](../cmp/trait.ord#method.clamp) [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> PartialEq<GeneratorState<Y, R>> for GeneratorState<Y, R>where Y: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<Y>, R: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<R>, [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)#### fn eq(&self, other: &GeneratorState<Y, R>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> PartialOrd<GeneratorState<Y, R>> for GeneratorState<Y, R>where Y: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Y>, R: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<R>, [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)#### fn partial\_cmp(&self, other: &GeneratorState<Y, R>) -> Option<Ordering> This method returns an ordering between `self` and `other` values if one exists. [Read more](../cmp/trait.partialord#tymethod.partial_cmp) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1138)1.0.0 · #### fn lt(&self, other: &Rhs) -> bool This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](../cmp/trait.partialord#method.lt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1157)1.0.0 · #### fn le(&self, other: &Rhs) -> bool This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](../cmp/trait.partialord#method.le) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1175)1.0.0 · #### fn gt(&self, other: &Rhs) -> bool This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](../cmp/trait.partialord#method.gt) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#1194)1.0.0 · #### fn ge(&self, other: &Rhs) -> bool This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](../cmp/trait.partialord#method.ge) [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Copy for GeneratorState<Y, R>where Y: [Copy](../marker/trait.copy "trait std::marker::Copy"), R: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Eq for GeneratorState<Y, R>where Y: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), R: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> StructuralEq for GeneratorState<Y, R> [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> StructuralPartialEq for GeneratorState<Y, R> Auto Trait Implementations -------------------------- ### impl<Y, R> RefUnwindSafe for GeneratorState<Y, R>where R: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), Y: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Y, R> Send for GeneratorState<Y, R>where R: [Send](../marker/trait.send "trait std::marker::Send"), Y: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<Y, R> Sync for GeneratorState<Y, R>where R: [Sync](../marker/trait.sync "trait std::marker::Sync"), Y: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<Y, R> Unpin for GeneratorState<Y, R>where R: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), Y: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<Y, R> UnwindSafe for GeneratorState<Y, R>where R: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Y: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Trait std::ops::OneSidedRange Trait std::ops::OneSidedRange ============================= ``` pub trait OneSidedRange<T>: RangeBounds<T>where    T: ?Sized,{ } ``` 🔬This is a nightly-only experimental API. (`one_sided_range` [#69780](https://github.com/rust-lang/rust/issues/69780)) `OneSidedRange` is implemented for built-in range types that are unbounded on one side. For example, `a..`, `..b` and `..=c` implement `OneSidedRange`, but `..`, `d..e`, and `f..=g` do not. Types that implement `OneSidedRange<T>` must return `Bound::Unbounded` from one of `RangeBounds::start_bound` or `RangeBounds::end_bound`. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#988)### impl<T> OneSidedRange<T> for RangeFrom<T>where [RangeFrom](struct.rangefrom "struct std::ops::RangeFrom")<T>: [RangeBounds](trait.rangebounds "trait std::ops::RangeBounds")<T>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#985)### impl<T> OneSidedRange<T> for RangeTo<T>where [RangeTo](struct.rangeto "struct std::ops::RangeTo")<T>: [RangeBounds](trait.rangebounds "trait std::ops::RangeBounds")<T>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#991)### impl<T> OneSidedRange<T> for RangeToInclusive<T>where [RangeToInclusive](struct.rangetoinclusive "struct std::ops::RangeToInclusive")<T>: [RangeBounds](trait.rangebounds "trait std::ops::RangeBounds")<T>, rust Trait std::ops::FromResidual Trait std::ops::FromResidual ============================ ``` pub trait FromResidual<R = <Self as Try>::Residual> { fn from_residual(residual: R) -> Self; } ``` 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used to specify which residuals can be converted into which [`crate::ops::Try`](trait.try "crate::ops::Try") types. Every `Try` type needs to be recreatable from its own associated `Residual` type, but can also have additional `FromResidual` implementations to support interconversion with other `Try` types. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#410)#### fn from\_residual(residual: R) -> Self 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. This should be implemented consistently with the `branch` method such that applying the `?` operator will get back an equivalent residual: `FromResidual::from_residual(r).branch() --> ControlFlow::Break(r)`. (It must not be an *identical* residual when interconversion is involved.) ##### Examples ``` #![feature(try_trait_v2)] use std::ops::{ControlFlow, FromResidual}; assert_eq!(Result::<String, i64>::from_residual(Err(3_u8)), Err(3)); assert_eq!(Option::<String>::from_residual(None), None); assert_eq!( ControlFlow::<_, String>::from_residual(ControlFlow::Break(5)), ControlFlow::Break(5), ); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#117)### impl<B, C> FromResidual<<ControlFlow<B, C> as Try>::Residual> for ControlFlow<B, C> [source](https://doc.rust-lang.org/src/core/option.rs.html#2306)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> FromResidual<<Option<T> as Try>::Residual> for Option<T> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#90)### impl<T> FromResidual<<Ready<T> as Try>::Residual> for Ready<T> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#100)### impl<T> FromResidual<Ready<Infallible>> for Poll<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#2316)### impl<T> FromResidual<Yeet<()>> for Option<T> [source](https://doc.rust-lang.org/src/core/result.rs.html#2098-2099)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>where F: [From](../convert/trait.from "trait std::convert::From")<E>, [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#311-312)### impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Option<Result<T, F>>>where F: [From](../convert/trait.from "trait std::convert::From")<E>, [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#280)### impl<T, E, F> FromResidual<Result<Infallible, E>> for Poll<Result<T, F>>where F: [From](../convert/trait.from "trait std::convert::From")<E>, [source](https://doc.rust-lang.org/src/core/result.rs.html#2111)### impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>where F: [From](../convert/trait.from "trait std::convert::From")<E>, rust Module std::ops Module std::ops =============== Overloadable operators. Implementing these traits allows you to overload certain operators. Some of these traits are imported by the prelude, so they are available in every Rust program. Only operators backed by traits can be overloaded. For example, the addition operator (`+`) can be overloaded through the [`Add`](trait.add "Add") trait, but since the assignment operator (`=`) has no backing trait, there is no way of overloading its semantics. Additionally, this module does not provide any mechanism to create new operators. If traitless overloading or custom operators are required, you should look toward macros or compiler plugins to extend Rust’s syntax. Implementations of operator traits should be unsurprising in their respective contexts, keeping in mind their usual meanings and [operator precedence](../../reference/expressions#expression-precedence). For example, when implementing [`Mul`](trait.mul "Mul"), the operation should have some resemblance to multiplication (and share expected properties like associativity). Note that the `&&` and `||` operators short-circuit, i.e., they only evaluate their second operand if it contributes to the result. Since this behavior is not enforceable by traits, `&&` and `||` are not supported as overloadable operators. Many of the operators take their operands by value. In non-generic contexts involving built-in types, this is usually not a problem. However, using these operators in generic code, requires some attention if values have to be reused as opposed to letting the operators consume them. One option is to occasionally use [`clone`](../clone/trait.clone#tymethod.clone). Another option is to rely on the types involved providing additional operator implementations for references. For example, for a user-defined type `T` which is supposed to support addition, it is probably a good idea to have both `T` and `&T` implement the traits [`Add<T>`](trait.add "Add") and [`Add<&T>`](trait.add "Add") so that generic code can be written without unnecessary cloning. Examples -------- This example creates a `Point` struct that implements [`Add`](trait.add "Add") and [`Sub`](trait.sub "Sub"), and then demonstrates adding and subtracting two `Point`s. ``` use std::ops::{Add, Sub}; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl Add for Point { type Output = Self; fn add(self, other: Self) -> Self { Self {x: self.x + other.x, y: self.y + other.y} } } impl Sub for Point { type Output = Self; fn sub(self, other: Self) -> Self { Self {x: self.x - other.x, y: self.y - other.y} } } assert_eq!(Point {x: 3, y: 3}, Point {x: 1, y: 0} + Point {x: 2, y: 3}); assert_eq!(Point {x: -1, y: -3}, Point {x: 1, y: 0} - Point {x: 2, y: 3}); ``` See the documentation for each trait for an example implementation. The [`Fn`](trait.fn "Fn"), [`FnMut`](trait.fnmut "FnMut"), and [`FnOnce`](trait.fnonce "FnOnce") traits are implemented by types that can be invoked like functions. Note that [`Fn`](trait.fn "Fn") takes `&self`, [`FnMut`](trait.fnmut "FnMut") takes `&mut self` and [`FnOnce`](trait.fnonce "FnOnce") takes `self`. These correspond to the three kinds of methods that can be invoked on an instance: call-by-reference, call-by-mutable-reference, and call-by-value. The most common use of these traits is to act as bounds to higher-level functions that take functions or closures as arguments. Taking a [`Fn`](trait.fn "Fn") as a parameter: ``` fn call_with_one<F>(func: F) -> usize where F: Fn(usize) -> usize { func(1) } let double = |x| x * 2; assert_eq!(call_with_one(double), 2); ``` Taking a [`FnMut`](trait.fnmut "FnMut") as a parameter: ``` fn do_twice<F>(mut func: F) where F: FnMut() { func(); func(); } let mut x: usize = 1; { let add_two_to_x = || x += 2; do_twice(add_two_to_x); } assert_eq!(x, 5); ``` Taking a [`FnOnce`](trait.fnonce "FnOnce") as a parameter: ``` fn consume_with_relish<F>(func: F) where F: FnOnce() -> String { // `func` consumes its captured variables, so it cannot be run more // than once println!("Consumed: {}", func()); println!("Delicious!"); // Attempting to invoke `func()` again will throw a `use of moved // value` error for `func` } let x = String::from("x"); let consume_and_return_x = move || x; consume_with_relish(consume_and_return_x); // `consume_and_return_x` can no longer be invoked at this point ``` Structs ------- [Yeet](struct.yeet "std::ops::Yeet struct")Experimental Implement `FromResidual<Yeet<T>>` on your type to enable `do yeet expr` syntax in functions returning your type. [Range](struct.range "std::ops::Range struct") A (half-open) range bounded inclusively below and exclusively above (`start..end`). [RangeFrom](struct.rangefrom "std::ops::RangeFrom struct") A range only bounded inclusively below (`start..`). [RangeFull](struct.rangefull "std::ops::RangeFull struct") An unbounded range (`..`). [RangeInclusive](struct.rangeinclusive "std::ops::RangeInclusive struct") A range bounded inclusively below and above (`start..=end`). [RangeTo](struct.rangeto "std::ops::RangeTo struct") A range only bounded exclusively above (`..end`). [RangeToInclusive](struct.rangetoinclusive "std::ops::RangeToInclusive struct") A range only bounded inclusively above (`..=end`). Enums ----- [GeneratorState](enum.generatorstate "std::ops::GeneratorState enum")Experimental The result of a generator resumption. [Bound](enum.bound "std::ops::Bound enum") An endpoint of a range of keys. [ControlFlow](enum.controlflow "std::ops::ControlFlow enum") Used to tell an operation whether it should exit early or go on as usual. Traits ------ [CoerceUnsized](trait.coerceunsized "std::ops::CoerceUnsized trait")Experimental Trait that indicates that this is a pointer or a wrapper for one, where unsizing can be performed on the pointee. [DispatchFromDyn](trait.dispatchfromdyn "std::ops::DispatchFromDyn trait")Experimental `DispatchFromDyn` is used in the implementation of object safety checks (specifically allowing arbitrary self types), to guarantee that a method’s receiver type can be dispatched on. [FromResidual](trait.fromresidual "std::ops::FromResidual trait")Experimental Used to specify which residuals can be converted into which [`crate::ops::Try`](trait.try "crate::ops::Try") types. [Generator](trait.generator "std::ops::Generator trait")Experimental The trait implemented by builtin generator types. [OneSidedRange](trait.onesidedrange "std::ops::OneSidedRange trait")Experimental `OneSidedRange` is implemented for built-in range types that are unbounded on one side. For example, `a..`, `..b` and `..=c` implement `OneSidedRange`, but `..`, `d..e`, and `f..=g` do not. [Residual](trait.residual "std::ops::Residual trait")Experimental Allows retrieving the canonical type implementing [`Try`](trait.try "Try") that has this type as its residual and allows it to hold an `O` as its output. [Try](trait.try "std::ops::Try trait")Experimental The `?` operator and `try {}` blocks. [Add](trait.add "std::ops::Add trait") The addition operator `+`. [AddAssign](trait.addassign "std::ops::AddAssign trait") The addition assignment operator `+=`. [BitAnd](trait.bitand "std::ops::BitAnd trait") The bitwise AND operator `&`. [BitAndAssign](trait.bitandassign "std::ops::BitAndAssign trait") The bitwise AND assignment operator `&=`. [BitOr](trait.bitor "std::ops::BitOr trait") The bitwise OR operator `|`. [BitOrAssign](trait.bitorassign "std::ops::BitOrAssign trait") The bitwise OR assignment operator `|=`. [BitXor](trait.bitxor "std::ops::BitXor trait") The bitwise XOR operator `^`. [BitXorAssign](trait.bitxorassign "std::ops::BitXorAssign trait") The bitwise XOR assignment operator `^=`. [Deref](trait.deref "std::ops::Deref trait") Used for immutable dereferencing operations, like `*v`. [DerefMut](trait.derefmut "std::ops::DerefMut trait") Used for mutable dereferencing operations, like in `*v = 1;`. [Div](trait.div "std::ops::Div trait") The division operator `/`. [DivAssign](trait.divassign "std::ops::DivAssign trait") The division assignment operator `/=`. [Drop](trait.drop "std::ops::Drop trait") Custom code within the destructor. [Fn](trait.fn "std::ops::Fn trait") The version of the call operator that takes an immutable receiver. [FnMut](trait.fnmut "std::ops::FnMut trait") The version of the call operator that takes a mutable receiver. [FnOnce](trait.fnonce "std::ops::FnOnce trait") The version of the call operator that takes a by-value receiver. [Index](trait.index "std::ops::Index trait") Used for indexing operations (`container[index]`) in immutable contexts. [IndexMut](trait.indexmut "std::ops::IndexMut trait") Used for indexing operations (`container[index]`) in mutable contexts. [Mul](trait.mul "std::ops::Mul trait") The multiplication operator `*`. [MulAssign](trait.mulassign "std::ops::MulAssign trait") The multiplication assignment operator `*=`. [Neg](trait.neg "std::ops::Neg trait") The unary negation operator `-`. [Not](trait.not "std::ops::Not trait") The unary logical negation operator `!`. [RangeBounds](trait.rangebounds "std::ops::RangeBounds trait") `RangeBounds` is implemented by Rust’s built-in range types, produced by range syntax like `..`, `a..`, `..b`, `..=c`, `d..e`, or `f..=g`. [Rem](trait.rem "std::ops::Rem trait") The remainder operator `%`. [RemAssign](trait.remassign "std::ops::RemAssign trait") The remainder assignment operator `%=`. [Shl](trait.shl "std::ops::Shl trait") The left shift operator `<<`. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for `_ << _`, setting the result type for integer operations to the type of the left-hand-side operand. This means that though `a << b` and `a.shl(b)` are one and the same from an evaluation standpoint, they are different when it comes to type inference. [ShlAssign](trait.shlassign "std::ops::ShlAssign trait") The left shift assignment operator `<<=`. [Shr](trait.shr "std::ops::Shr trait") The right shift operator `>>`. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for `_ >> _`, setting the result type for integer operations to the type of the left-hand-side operand. This means that though `a >> b` and `a.shr(b)` are one and the same from an evaluation standpoint, they are different when it comes to type inference. [ShrAssign](trait.shrassign "std::ops::ShrAssign trait") The right shift assignment operator `>>=`. [Sub](trait.sub "std::ops::Sub trait") The subtraction operator `-`. [SubAssign](trait.subassign "std::ops::SubAssign trait") The subtraction assignment operator `-=`.
programming_docs
rust Trait std::ops::MulAssign Trait std::ops::MulAssign ========================= ``` pub trait MulAssign<Rhs = Self> { fn mul_assign(&mut self, rhs: Rhs); } ``` The multiplication assignment operator `*=`. Examples -------- ``` use std::ops::MulAssign; #[derive(Debug, PartialEq)] struct Frequency { hertz: f64 } impl MulAssign<f64> for Frequency { fn mul_assign(&mut self, rhs: f64) { self.hertz *= rhs; } } let mut frequency = Frequency { hertz: 50.0 }; frequency *= 4.0; assert_eq!(Frequency { hertz: 200.0 }, frequency); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#894)#### fn mul\_assign(&mut self, rhs: Rhs) Performs the `*=` operation. ##### Example ``` let mut x: u32 = 12; x *= 2; assert_eq!(x, 24); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl MulAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/time.rs.html#960)1.9.0 · ### impl MulAssign<u32> for Duration [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl MulAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl MulAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl MulAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> MulAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](trait.mul "trait std::ops::Mul")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](trait.mul "trait std::ops::Mul")<U>>::[Output](trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Trait std::ops::CoerceUnsized Trait std::ops::CoerceUnsized ============================= ``` pub trait CoerceUnsized<T>where    T: ?Sized,{ } ``` 🔬This is a nightly-only experimental API. (`coerce_unsized` [#27732](https://github.com/rust-lang/rust/issues/27732)) Trait that indicates that this is a pointer or a wrapper for one, where unsizing can be performed on the pointee. See the [DST coercion RFC](https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md) and [the nomicon entry on coercion](https://doc.rust-lang.org/nomicon/coercions.html) for more details. For builtin pointer types, pointers to `T` will coerce to pointers to `U` if `T: Unsize<U>` by converting from a thin pointer to a fat pointer. For custom types, the coercion here works by coercing `Foo<T>` to `Foo<U>` provided an impl of `CoerceUnsized<Foo<U>> for Foo<T>` exists. Such an impl can only be written if `Foo<T>` has only a single non-phantomdata field involving `T`. If the type of that field is `Bar<T>`, an implementation of `CoerceUnsized<Bar<U>> for Bar<T>` must exist. The coercion will work by coercing the `Bar<T>` field into `Bar<U>` and filling in the rest of the fields from `Foo<T>` to create a `Foo<U>`. This will effectively drill down to a pointer field and coerce that. Generally, for smart pointers you will implement `CoerceUnsized<Ptr<U>> for Ptr<T> where T: Unsize<U>, U: ?Sized`, with an optional `?Sized` bound on `T` itself. For wrapper types that directly embed `T` like `Cell<T>` and `RefCell<T>`, you can directly implement `CoerceUnsized<Wrap<U>> for Wrap<T> where T: CoerceUnsized<U>`. This will let coercions of types like `Cell<Box<T>>` work. [`Unsize`](../marker/trait.unsize) is used to mark types which can be coerced to DSTs if behind pointers. It is implemented automatically by the compiler. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#55)### impl<'a, 'b, T, U> CoerceUnsized<&'a U> for &'b Twhere 'b: 'a, T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#45)### impl<'a, 'b, T, U> CoerceUnsized<&'a U> for &'b mut Twhere 'b: 'a, T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#58)### impl<'a, T, U> CoerceUnsized<\*const U> for &'a Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#51)### impl<'a, T, U> CoerceUnsized<\*const U> for &'a mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#48)### impl<'a, T, U> CoerceUnsized<\*mut U> for &'a mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#42)### impl<'a, T, U> CoerceUnsized<&'a mut U> for &'a mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1491)### impl<'b, T, U> CoerceUnsized<Ref<'b, U>> for Ref<'b, T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1737)### impl<'b, T, U> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/pin.rs.html#915)1.33.0 · ### impl<P, U> CoerceUnsized<Pin<U>> for Pin<P>where P: [CoerceUnsized](trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#69)### impl<T, U> CoerceUnsized<\*const U> for \*const Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#65)### impl<T, U> CoerceUnsized<\*const U> for \*mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#62)### impl<T, U> CoerceUnsized<\*mut U> for \*mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#571)### impl<T, U> CoerceUnsized<Cell<U>> for Cell<T>where T: [CoerceUnsized](trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/cell.rs.html#1265)### impl<T, U> CoerceUnsized<RefCell<U>> for RefCell<T>where T: [CoerceUnsized](trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/cell.rs.html#2109)### impl<T, U> CoerceUnsized<SyncUnsafeCell<U>> for SyncUnsafeCell<T>where T: [CoerceUnsized](trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/cell.rs.html#2018)### impl<T, U> CoerceUnsized<UnsafeCell<U>> for UnsafeCell<T>where T: [CoerceUnsized](trait.coerceunsized "trait std::ops::CoerceUnsized")<U>, [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#712)### impl<T, U> CoerceUnsized<NonNull<U>> for NonNull<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#331)### impl<T, U> CoerceUnsized<Rc<U>> for Rc<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2162)### impl<T, U> CoerceUnsized<Weak<U>> for std::rc::Weak<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#249)### impl<T, U> CoerceUnsized<Arc<U>> for Arc<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#301)### impl<T, U> CoerceUnsized<Weak<U>> for std::sync::Weak<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1959)### impl<T, U, A> CoerceUnsized<Box<U, A>> for Box<T, A>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), rust Trait std::ops::IndexMut Trait std::ops::IndexMut ======================== ``` pub trait IndexMut<Idx>: Index<Idx>where    Idx: ?Sized,{ fn index_mut(&mut self, index: Idx) -> &mut Self::Output; } ``` Used for indexing operations (`container[index]`) in mutable contexts. `container[index]` is actually syntactic sugar for `*container.index_mut(index)`, but only when used as a mutable value. If an immutable value is requested, the [`Index`](trait.index "Index") trait is used instead. This allows nice things such as `v[index] = value`. Examples -------- A very simple implementation of a `Balance` struct that has two sides, where each can be indexed mutably and immutably. ``` use std::ops::{Index, IndexMut}; #[derive(Debug)] enum Side { Left, Right, } #[derive(Debug, PartialEq)] enum Weight { Kilogram(f32), Pound(f32), } struct Balance { pub left: Weight, pub right: Weight, } impl Index<Side> for Balance { type Output = Weight; fn index(&self, index: Side) -> &Self::Output { println!("Accessing {index:?}-side of balance immutably"); match index { Side::Left => &self.left, Side::Right => &self.right, } } } impl IndexMut<Side> for Balance { fn index_mut(&mut self, index: Side) -> &mut Self::Output { println!("Accessing {index:?}-side of balance mutably"); match index { Side::Left => &mut self.left, Side::Right => &mut self.right, } } } let mut balance = Balance { right: Weight::Kilogram(2.5), left: Weight::Pound(1.5), }; // In this case, `balance[Side::Right]` is sugar for // `*balance.index(Side::Right)`, since we are only *reading* // `balance[Side::Right]`, not writing it. assert_eq!(balance[Side::Right], Weight::Kilogram(2.5)); // However, in this case `balance[Side::Left]` is sugar for // `*balance.index_mut(Side::Left)`, since we are writing // `balance[Side::Left]`. balance[Side::Left] = Weight::Kilogram(3.0); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/index.rs.html#174)#### fn index\_mut(&mut self, index: Idx) -> &mut Self::Output Performs the mutable indexing (`container[index]`) operation. ##### Panics May panic if the index is out of bounds. Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2386)1.3.0 · ### impl IndexMut<Range<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2400)1.3.0 · ### impl IndexMut<RangeFrom<usize>> for String [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#502-507)1.44.0 · ### impl IndexMut<RangeFull> for OsString [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2407)1.3.0 · ### impl IndexMut<RangeFull> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2414)1.26.0 · ### impl IndexMut<RangeInclusive<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2393)1.3.0 · ### impl IndexMut<RangeTo<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2421)1.26.0 · ### impl IndexMut<RangeToInclusive<usize>> for String [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#71)const: unstable · ### impl<I> IndexMut<I> for strwhere I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[str](../primitive.str)>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#23)### impl<I, T, const LANES: usize> IndexMut<I> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2938)### impl<T, A> IndexMut<usize> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#24)const: unstable · ### impl<T, I> IndexMut<I> for [T]where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2637)### impl<T, I, A> IndexMut<I> for Vec<T, A>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#303)1.50.0 (const: unstable) · ### impl<T, I, const N: usize> IndexMut<I> for [T; N]where [[T]](../primitive.slice): [IndexMut](trait.indexmut "trait std::ops::IndexMut")<I>, rust Struct std::ops::RangeFull Struct std::ops::RangeFull ========================== ``` pub struct RangeFull; ``` An unbounded range (`..`). `RangeFull` is primarily used as a [slicing index](../slice/trait.sliceindex), its shorthand is `..`. It cannot serve as an [`Iterator`](../iter/trait.iterator "Iterator") because it doesn’t have a starting point. Examples -------- The `..` syntax is a `RangeFull`: ``` assert_eq!((..), std::ops::RangeFull); ``` It does not have an [`IntoIterator`](../iter/trait.intoiterator "IntoIterator") implementation, so you can’t use it in a `for` loop directly. This won’t compile: ⓘ ``` for i in .. { // ... } ``` Used as a [slicing index](../slice/trait.sliceindex), `RangeFull` produces the full array as a slice. ``` let arr = [0, 1, 2, 3, 4]; assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]); // This is the `RangeFull` assert_eq!(arr[ .. 3], [0, 1, 2 ]); assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); assert_eq!(arr[1.. ], [ 1, 2, 3, 4]); assert_eq!(arr[1.. 3], [ 1, 2 ]); assert_eq!(arr[1..=3], [ 1, 2, 3 ]); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Clone for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)#### fn clone(&self) -> RangeFull Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#46)### impl Debug for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#47)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Default for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)#### fn default() -> RangeFull Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Hash for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1039)1.7.0 · ### impl Index<RangeFull> for CString #### type Output = CStr The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1043)#### fn index(&self, \_index: RangeFull) -> &CStr Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#492-499)### impl Index<RangeFull> for OsString #### type Output = OsStr The returned type after indexing. [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#496-498)#### fn index(&self, \_index: RangeFull) -> &OsStr Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2358)### impl Index<RangeFull> for String #### type Output = str The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2362)#### fn index(&self, \_index: RangeFull) -> &str Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#502-507)1.44.0 · ### impl IndexMut<RangeFull> for OsString [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#504-506)#### fn index\_mut(&mut self, \_index: RangeFull) -> &mut OsStr Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2407)1.3.0 · ### impl IndexMut<RangeFull> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2409)#### fn index\_mut(&mut self, \_index: RangeFull) -> &mut str Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl PartialEq<RangeFull> for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)#### fn eq(&self, other: &RangeFull) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#830)1.28.0 · ### impl<T> RangeBounds<T> for RangeFullwhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#831)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#834)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#420)1.15.0 (const: unstable) · ### impl<T> SliceIndex<[T]> for RangeFull #### type Output = [T] The output type returned by methods. [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#424)const: unstable · #### fn get(self, slice: &[T]) -> Option<&[T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#429)const: unstable · #### fn get\_mut(self, slice: &mut [T]) -> Option<&mut [T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#434)const: unstable · #### unsafe fn get\_unchecked(self, slice: \*const [T]) -> \*const [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#439)const: unstable · #### unsafe fn get\_unchecked\_mut(self, slice: \*mut [T]) -> \*mut [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#444)const: unstable · #### fn index(self, slice: &[T]) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#449)const: unstable · #### fn index\_mut(self, slice: &mut [T]) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#102)1.20.0 (const: unstable) · ### impl SliceIndex<str> for RangeFull Implements substring slicing with syntax `&self[..]` or `&mut self[..]`. Returns a slice of the whole string, i.e., returns `&self` or `&mut self`. Equivalent to `&self[0 .. len]` or `&mut self[0 .. len]`. Unlike other indexing operations, this can never panic. This operation is *O*(1). Prior to 1.20.0, these indexing operations were still supported by direct implementation of `Index` and `IndexMut`. Equivalent to `&self[0 .. len]` or `&mut self[0 .. len]`. #### type Output = str The output type returned by methods. [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#105)const: unstable · #### fn get(self, slice: &str) -> Option<&<RangeFull as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#109)const: unstable · #### fn get\_mut( self, slice: &mut str) -> Option<&mut <RangeFull as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#113)const: unstable · #### unsafe fn get\_unchecked( self, slice: \*const str) -> \*const <RangeFull as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#117)const: unstable · #### unsafe fn get\_unchecked\_mut( self, slice: \*mut str) -> \*mut <RangeFull as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#121)const: unstable · #### fn index(self, slice: &str) -> &<RangeFull as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#125)const: unstable · #### fn index\_mut( self, slice: &mut str) -> &mut <RangeFull as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Copy for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Eq for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl StructuralEq for RangeFull [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl StructuralPartialEq for RangeFull Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for RangeFull ### impl Send for RangeFull ### impl Sync for RangeFull ### impl Unpin for RangeFull ### impl UnwindSafe for RangeFull Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::ops::RangeToInclusive Struct std::ops::RangeToInclusive ================================= ``` pub struct RangeToInclusive<Idx> { pub end: Idx, } ``` A range only bounded inclusively above (`..=end`). The `RangeToInclusive` `..=end` contains all values with `x <= end`. It cannot serve as an [`Iterator`](../iter/trait.iterator "Iterator") because it doesn’t have a starting point. Examples -------- The `..=end` syntax is a `RangeToInclusive`: ``` assert_eq!((..=5), std::ops::RangeToInclusive{ end: 5 }); ``` It does not have an [`IntoIterator`](../iter/trait.intoiterator "IntoIterator") implementation, so you can’t use it in a `for` loop directly. This won’t compile: ⓘ ``` // error[E0277]: the trait bound `std::ops::RangeToInclusive<{integer}>: // std::iter::Iterator` is not satisfied for i in ..=5 { // ... } ``` When used as a [slicing index](../slice/trait.sliceindex), `RangeToInclusive` produces a slice of all array elements up to and including the index indicated by `end`. ``` let arr = [0, 1, 2, 3, 4]; assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]); assert_eq!(arr[ .. 3], [0, 1, 2 ]); assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); // This is a `RangeToInclusive` assert_eq!(arr[1.. ], [ 1, 2, 3, 4]); assert_eq!(arr[1.. 3], [ 1, 2 ]); assert_eq!(arr[1..=3], [ 1, 2, 3 ]); ``` Fields ------ `end: Idx`The upper bound of the range (inclusive) Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#601)### impl<Idx> RangeToInclusive<Idx>where Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#616-619)1.35.0 · #### pub fn contains<U>(&self, item: &U) -> boolwhere Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. ##### Examples ``` assert!( (..=5).contains(&-1_000_000_000)); assert!( (..=5).contains(&5)); assert!(!(..=5).contains(&6)); assert!( (..=1.0).contains(&1.0)); assert!(!(..=1.0).contains(&f32::NAN)); assert!(!(..=f32::NAN).contains(&0.5)); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> Clone for RangeToInclusive<Idx>where Idx: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)#### fn clone(&self) -> RangeToInclusive<Idx> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#593)### impl<Idx> Debug for RangeToInclusive<Idx>where Idx: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#594)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> Hash for RangeToInclusive<Idx>where Idx: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2376)### impl Index<RangeToInclusive<usize>> for String #### type Output = str The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2380)#### fn index(&self, index: RangeToInclusive<usize>) -> &str Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2421)### impl IndexMut<RangeToInclusive<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2423)#### fn index\_mut(&mut self, index: RangeToInclusive<usize>) -> &mut str Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> PartialEq<RangeToInclusive<Idx>> for RangeToInclusive<Idx>where Idx: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)#### fn eq(&self, other: &RangeToInclusive<Idx>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#966)1.28.0 · ### impl<T> RangeBounds<T> for RangeToInclusive<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#967)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#970)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#886)1.28.0 · ### impl<T> RangeBounds<T> for RangeToInclusive<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#887)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#890)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#500)const: unstable · ### impl<T> SliceIndex<[T]> for RangeToInclusive<usize> #### type Output = [T] The output type returned by methods. [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#504)const: unstable · #### fn get(self, slice: &[T]) -> Option<&[T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#509)const: unstable · #### fn get\_mut(self, slice: &mut [T]) -> Option<&mut [T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#514)const: unstable · #### unsafe fn get\_unchecked(self, slice: \*const [T]) -> \*const [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#520)const: unstable · #### unsafe fn get\_unchecked\_mut(self, slice: \*mut [T]) -> \*mut [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#526)const: unstable · #### fn index(self, slice: &[T]) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#531)const: unstable · #### fn index\_mut(self, slice: &mut [T]) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#455)const: unstable · ### impl SliceIndex<str> for RangeToInclusive<usize> Implements substring slicing with syntax `&self[..= end]` or `&mut self[..= end]`. Returns a slice of the given string from the byte range [0, `end`]. Equivalent to `&self [0 .. end + 1]`, except if `end` has the maximum value for `usize`. This operation is *O*(1). #### Panics Panics if `end` does not point to the ending byte offset of a character (`end + 1` is either a starting byte offset as defined by `is_char_boundary`, or equal to `len`), or if `end >= len`. #### type Output = str The output type returned by methods. [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#458)const: unstable · #### fn get( self, slice: &str) -> Option<&<RangeToInclusive<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#462)const: unstable · #### fn get\_mut( self, slice: &mut str) -> Option<&mut <RangeToInclusive<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#466)const: unstable · #### unsafe fn get\_unchecked( self, slice: \*const str) -> \*const <RangeToInclusive<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#471)const: unstable · #### unsafe fn get\_unchecked\_mut( self, slice: \*mut str) -> \*mut <RangeToInclusive<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#476)const: unstable · #### fn index( self, slice: &str) -> &<RangeToInclusive<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#483)const: unstable · #### fn index\_mut( self, slice: &mut str) -> &mut <RangeToInclusive<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> Copy for RangeToInclusive<Idx>where Idx: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> Eq for RangeToInclusive<Idx>where Idx: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#991)### impl<T> OneSidedRange<T> for RangeToInclusive<T>where [RangeToInclusive](struct.rangetoinclusive "struct std::ops::RangeToInclusive")<T>: [RangeBounds](trait.rangebounds "trait std::ops::RangeBounds")<T>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> StructuralEq for RangeToInclusive<Idx> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)### impl<Idx> StructuralPartialEq for RangeToInclusive<Idx> Auto Trait Implementations -------------------------- ### impl<Idx> RefUnwindSafe for RangeToInclusive<Idx>where Idx: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> Send for RangeToInclusive<Idx>where Idx: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<Idx> Sync for RangeToInclusive<Idx>where Idx: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<Idx> Unpin for RangeToInclusive<Idx>where Idx: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<Idx> UnwindSafe for RangeToInclusive<Idx>where Idx: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Trait std::ops::BitOr Trait std::ops::BitOr ===================== ``` pub trait BitOr<Rhs = Self> { type Output; fn bitor(self, rhs: Rhs) -> Self::Output; } ``` The bitwise OR operator `|`. Note that `Rhs` is `Self` by default, but this is not mandatory. Examples -------- An implementation of `BitOr` for a wrapper around `bool`. ``` use std::ops::BitOr; #[derive(Debug, PartialEq)] struct Scalar(bool); impl BitOr for Scalar { type Output = Self; // rhs is the "right-hand side" of the expression `a | b` fn bitor(self, rhs: Self) -> Self::Output { Self(self.0 | rhs.0) } } assert_eq!(Scalar(true) | Scalar(true), Scalar(true)); assert_eq!(Scalar(true) | Scalar(false), Scalar(true)); assert_eq!(Scalar(false) | Scalar(true), Scalar(true)); assert_eq!(Scalar(false) | Scalar(false), Scalar(false)); ``` An implementation of `BitOr` for a wrapper around `Vec<bool>`. ``` use std::ops::BitOr; #[derive(Debug, PartialEq)] struct BooleanVector(Vec<bool>); impl BitOr for BooleanVector { type Output = Self; fn bitor(self, Self(rhs): Self) -> Self::Output { let Self(lhs) = self; assert_eq!(lhs.len(), rhs.len()); Self( lhs.iter() .zip(rhs.iter()) .map(|(x, y)| *x | *y) .collect() ) } } let bv1 = BooleanVector(vec![true, true, false, false]); let bv2 = BooleanVector(vec![true, false, true, false]); let expected = BooleanVector(vec![true, true, true, false]); assert_eq!(bv1 | bv2, expected); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#250)#### type Output The resulting type after applying the `|` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#264)#### fn bitor(self, rhs: Rhs) -> Self::Output Performs the `|` operation. ##### Examples ``` assert_eq!(true | false, true); assert_eq!(false | false, false); assert_eq!(5u8 | 1u8, 5); assert_eq!(5u8 | 2u8, 7); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&bool> for &bool #### type Output = <bool as BitOr<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&bool> for bool #### type Output = <bool as BitOr<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i8> for &i8 #### type Output = <i8 as BitOr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i8> for i8 #### type Output = <i8 as BitOr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i16> for &i16 #### type Output = <i16 as BitOr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i16> for i16 #### type Output = <i16 as BitOr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i32> for &i32 #### type Output = <i32 as BitOr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i32> for i32 #### type Output = <i32 as BitOr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i64> for &i64 #### type Output = <i64 as BitOr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i64> for i64 #### type Output = <i64 as BitOr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i128> for &i128 #### type Output = <i128 as BitOr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&i128> for i128 #### type Output = <i128 as BitOr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&isize> for &isize #### type Output = <isize as BitOr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&isize> for isize #### type Output = <isize as BitOr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u8> for &u8 #### type Output = <u8 as BitOr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u8> for u8 #### type Output = <u8 as BitOr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u16> for &u16 #### type Output = <u16 as BitOr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u16> for u16 #### type Output = <u16 as BitOr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u32> for &u32 #### type Output = <u32 as BitOr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u32> for u32 #### type Output = <u32 as BitOr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u64> for &u64 #### type Output = <u64 as BitOr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u64> for u64 #### type Output = <u64 as BitOr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u128> for &u128 #### type Output = <u128 as BitOr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&u128> for u128 #### type Output = <u128 as BitOr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&usize> for &usize #### type Output = <usize as BitOr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<&usize> for usize #### type Output = <usize as BitOr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<bool> for bool #### type Output = bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i8> for NonZeroI8 #### type Output = NonZeroI8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i16> for NonZeroI16 #### type Output = NonZeroI16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i32> for NonZeroI32 #### type Output = NonZeroI32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i64> for NonZeroI64 #### type Output = NonZeroI64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i128> for NonZeroI128 #### type Output = NonZeroI128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<isize> for NonZeroIsize #### type Output = NonZeroIsize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u8> for NonZeroU8 #### type Output = NonZeroU8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u16> for NonZeroU16 #### type Output = NonZeroU16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u32> for NonZeroU32 #### type Output = NonZeroU32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u64> for NonZeroU64 #### type Output = NonZeroU64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u128> for NonZeroU128 #### type Output = NonZeroU128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<usize> for NonZeroUsize #### type Output = NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI8> for i8 #### type Output = NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI8> for NonZeroI8 #### type Output = NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI16> for i16 #### type Output = NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI16> for NonZeroI16 #### type Output = NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI32> for i32 #### type Output = NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI32> for NonZeroI32 #### type Output = NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI64> for i64 #### type Output = NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI64> for NonZeroI64 #### type Output = NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI128> for i128 #### type Output = NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroI128> for NonZeroI128 #### type Output = NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroIsize> for isize #### type Output = NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroIsize> for NonZeroIsize #### type Output = NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU8> for u8 #### type Output = NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU8> for NonZeroU8 #### type Output = NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU16> for u16 #### type Output = NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU16> for NonZeroU16 #### type Output = NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU32> for u32 #### type Output = NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU32> for NonZeroU32 #### type Output = NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU64> for u64 #### type Output = NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU64> for NonZeroU64 #### type Output = NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU128> for u128 #### type Output = NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroU128> for NonZeroU128 #### type Output = NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroUsize> for usize #### type Output = NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<NonZeroUsize> for NonZeroUsize #### type Output = NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOr<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOr<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<bool> for &'a bool #### type Output = <bool as BitOr<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<i8> for &'a i8 #### type Output = <i8 as BitOr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<i16> for &'a i16 #### type Output = <i16 as BitOr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<i32> for &'a i32 #### type Output = <i32 as BitOr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<i64> for &'a i64 #### type Output = <i64 as BitOr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<i128> for &'a i128 #### type Output = <i128 as BitOr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<isize> for &'a isize #### type Output = <isize as BitOr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<u8> for &'a u8 #### type Output = <u8 as BitOr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<u16> for &'a u16 #### type Output = <u16 as BitOr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<u32> for &'a u32 #### type Output = <u32 as BitOr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<u64> for &'a u64 #### type Output = <u64 as BitOr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<u128> for &'a u128 #### type Output = <u128 as BitOr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitOr<usize> for &'a usize #### type Output = <usize as BitOr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as BitOr<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as BitOr<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as BitOr<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as BitOr<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as BitOr<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as BitOr<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as BitOr<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as BitOr<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as BitOr<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as BitOr<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as BitOr<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitOr<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as BitOr<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as BitOr<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as BitOr<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as BitOr<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as BitOr<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as BitOr<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as BitOr<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as BitOr<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as BitOr<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as BitOr<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as BitOr<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as BitOr<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitOr<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as BitOr<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> BitOr<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](trait.bitor "trait std::ops::BitOr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](trait.bitor "trait std::ops::BitOr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1454)### impl<T, A> BitOr<&BTreeSet<T, A>> for &BTreeSet<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Output = BTreeSet<T, A> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1123-1153)### impl<T, S> BitOr<&HashSet<T, S>> for &HashSet<T, S>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Clone](../clone/trait.clone "trait std::clone::Clone"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher") + [Default](../default/trait.default "trait std::default::Default"), #### type Output = HashSet<T, S> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitOr<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](trait.bitor "trait std::ops::BitOr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](trait.bitor "trait std::ops::BitOr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#379)### impl<T, const LANES: usize> BitOr<bool> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#392)### impl<T, const LANES: usize> BitOr<Mask<T, LANES>> for boolwhere T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#366)### impl<T, const LANES: usize> BitOr<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitOr<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](trait.bitor "trait std::ops::BitOr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](trait.bitor "trait std::ops::BitOr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitOr<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::Index Trait std::ops::Index ===================== ``` pub trait Index<Idx>where    Idx: ?Sized,{ type Output: ?Sized; fn index(&self, index: Idx) -> &Self::Output; } ``` Used for indexing operations (`container[index]`) in immutable contexts. `container[index]` is actually syntactic sugar for `*container.index(index)`, but only when used as an immutable value. If a mutable value is requested, [`IndexMut`](trait.indexmut "IndexMut") is used instead. This allows nice things such as `let value = v[index]` if the type of `value` implements [`Copy`](../marker/trait.copy "Copy"). Examples -------- The following example implements `Index` on a read-only `NucleotideCount` container, enabling individual counts to be retrieved with index syntax. ``` use std::ops::Index; enum Nucleotide { A, C, G, T, } struct NucleotideCount { a: usize, c: usize, g: usize, t: usize, } impl Index<Nucleotide> for NucleotideCount { type Output = usize; fn index(&self, nucleotide: Nucleotide) -> &Self::Output { match nucleotide { Nucleotide::A => &self.a, Nucleotide::C => &self.c, Nucleotide::G => &self.g, Nucleotide::T => &self.t, } } } let nucleotide_count = NucleotideCount {a: 14, c: 9, g: 10, t: 12}; assert_eq!(nucleotide_count[Nucleotide::A], 14); assert_eq!(nucleotide_count[Nucleotide::C], 9); assert_eq!(nucleotide_count[Nucleotide::G], 10); assert_eq!(nucleotide_count[Nucleotide::T], 12); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/index.rs.html#61)#### type Output: ?Sized The returned type after indexing. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/index.rs.html#70)#### fn index(&self, index: Idx) -> &Self::Output Performs the indexing (`container[index]`) operation. ##### Panics May panic if the index is out of bounds. Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2331)### impl Index<Range<usize>> for String #### type Output = str [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#582)1.47.0 · ### impl Index<RangeFrom<usize>> for CStr #### type Output = CStr [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2349)### impl Index<RangeFrom<usize>> for String #### type Output = str [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#1039)1.7.0 · ### impl Index<RangeFull> for CString #### type Output = CStr [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#492-499)### impl Index<RangeFull> for OsString #### type Output = OsStr [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2358)### impl Index<RangeFull> for String #### type Output = str [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2367)1.26.0 · ### impl Index<RangeInclusive<usize>> for String #### type Output = str [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2340)### impl Index<RangeTo<usize>> for String #### type Output = str [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2376)1.26.0 · ### impl Index<RangeToInclusive<usize>> for String #### type Output = str [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#57)const: unstable · ### impl<I> Index<I> for strwhere I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[str](../primitive.str)>, #### type Output = <I as SliceIndex<str>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#11)### impl<I, T, const LANES: usize> Index<I> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = <I as SliceIndex<[T]>>::Output [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2205)### impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), K: [Borrow](../borrow/trait.borrow "trait std::borrow::Borrow")<Q> + [Ord](../cmp/trait.ord "trait std::cmp::Ord"), Q: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Output = V [source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1325-1342)### impl<K, Q: ?Sized, V, S> Index<&Q> for HashMap<K, V, S>where K: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Borrow](../borrow/trait.borrow "trait std::borrow::Borrow")<Q>, Q: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"), #### type Output = V [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2928)### impl<T, A> Index<usize> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Output = T [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#10)const: unstable · ### impl<T, I> Index<I> for [T]where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, #### type Output = <I as SliceIndex<[T]>>::Output [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2623)### impl<T, I, A> Index<I> for Vec<T, A>where I: [SliceIndex](../slice/trait.sliceindex "trait std::slice::SliceIndex")<[[T]](../primitive.slice)>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Output = <I as SliceIndex<[T]>>::Output [source](https://doc.rust-lang.org/src/core/array/mod.rs.html#289)1.50.0 (const: unstable) · ### impl<T, I, const N: usize> Index<I> for [T; N]where [[T]](../primitive.slice): [Index](trait.index "trait std::ops::Index")<I>, #### type Output = <[T] as Index<I>>::Output rust Trait std::ops::Not Trait std::ops::Not =================== ``` pub trait Not { type Output; fn not(self) -> Self::Output; } ``` The unary logical negation operator `!`. Examples -------- An implementation of `Not` for `Answer`, which enables the use of `!` to invert its value. ``` use std::ops::Not; #[derive(Debug, PartialEq)] enum Answer { Yes, No, } impl Not for Answer { type Output = Self; fn not(self) -> Self::Output { match self { Answer::Yes => Answer::No, Answer::No => Answer::Yes } } } assert_eq!(!Answer::Yes, Answer::No); assert_eq!(!Answer::No, Answer::Yes); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#37)#### type Output The resulting type after applying the `!` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#51)#### fn not(self) -> Self::Output Performs the unary `!` operation. ##### Examples ``` assert_eq!(!true, false); assert_eq!(!false, true); assert_eq!(!1u8, 254); assert_eq!(!0u8, 255); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &bool #### type Output = <bool as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &i8 #### type Output = <i8 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &i16 #### type Output = <i16 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &i32 #### type Output = <i32 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &i64 #### type Output = <i64 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &i128 #### type Output = <i128 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &isize #### type Output = <isize as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &u8 #### type Output = <u8 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &u16 #### type Output = <u16 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &u32 #### type Output = <u32 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &u64 #### type Output = <u64 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &u128 #### type Output = <u128 as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for &usize #### type Output = <usize as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i8> #### type Output = <Saturating<i8> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i16> #### type Output = <Saturating<i16> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i32> #### type Output = <Saturating<i32> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i64> #### type Output = <Saturating<i64> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<i128> #### type Output = <Saturating<i128> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<isize> #### type Output = <Saturating<isize> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u8> #### type Output = <Saturating<u8> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u16> #### type Output = <Saturating<u16> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u32> #### type Output = <Saturating<u32> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u64> #### type Output = <Saturating<u64> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<u128> #### type Output = <Saturating<u128> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for &Saturating<usize> #### type Output = <Saturating<usize> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i8> #### type Output = <Wrapping<i8> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i16> #### type Output = <Wrapping<i16> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i32> #### type Output = <Wrapping<i32> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i64> #### type Output = <Wrapping<i64> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<i128> #### type Output = <Wrapping<i128> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<isize> #### type Output = <Wrapping<isize> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u8> #### type Output = <Wrapping<u8> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u16> #### type Output = <Wrapping<u16> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u32> #### type Output = <Wrapping<u32> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u64> #### type Output = <Wrapping<u64> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<u128> #### type Output = <Wrapping<u128> as Not>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for &Wrapping<usize> #### type Output = <Wrapping<usize> as Not>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for bool #### type Output = bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#73)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for ! #### type Output = ! [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Not for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Not for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#444)### impl<T, const LANES: usize> Not for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i8, LANES>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i16, LANES>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i32, LANES>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<i64, LANES>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<isize, LANES>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u8, LANES>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u16, LANES>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u32, LANES>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<u64, LANES>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#58-78)### impl<const LANES: usize> Not for Simd<usize, LANES>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, LANES>
programming_docs
rust Enum std::ops::Bound Enum std::ops::Bound ==================== ``` pub enum Bound<T> { Included(T), Excluded(T), Unbounded, } ``` An endpoint of a range of keys. Examples -------- `Bound`s are range endpoints: ``` use std::ops::Bound::*; use std::ops::RangeBounds; assert_eq!((..100).start_bound(), Unbounded); assert_eq!((1..12).start_bound(), Included(&1)); assert_eq!((1..12).end_bound(), Excluded(&12)); ``` Using a tuple of `Bound`s as an argument to [`BTreeMap::range`](../collections/btree_map/struct.btreemap#method.range). Note that in most cases, it’s better to use range syntax (`1..5`) instead. ``` use std::collections::BTreeMap; use std::ops::Bound::{Excluded, Included, Unbounded}; let mut map = BTreeMap::new(); map.insert(3, "a"); map.insert(5, "b"); map.insert(8, "c"); for (key, value) in map.range((Excluded(3), Included(8))) { println!("{key}: {value}"); } assert_eq!(Some((&3, &"a")), map.range((Unbounded, Included(5))).next()); ``` Variants -------- ### `Included(T)` An inclusive bound. ### `Excluded(T)` An exclusive bound. ### `Unbounded` An infinite endpoint. Indicates that there is no bound in this direction. Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#677)### impl<T> Bound<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#681)1.65.0 · #### pub fn as\_ref(&self) -> Bound<&T> Converts from `&Bound<T>` to `Bound<&T>`. [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#692)#### pub fn as\_mut(&mut self) -> Bound<&mut T> 🔬This is a nightly-only experimental API. (`bound_as_ref` [#80996](https://github.com/rust-lang/rust/issues/80996)) Converts from `&mut Bound<T>` to `Bound<&mut T>`. [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#725)#### pub fn map<U, F>(self, f: F) -> Bound<U>where F: [FnOnce](trait.fnonce "trait std::ops::FnOnce")(T) -> U, 🔬This is a nightly-only experimental API. (`bound_map` [#86026](https://github.com/rust-lang/rust/issues/86026)) Maps a `Bound<T>` to a `Bound<U>` by applying a function to the contained value (including both `Included` and `Excluded`), returning a `Bound` of the same kind. ##### Examples ``` #![feature(bound_map)] use std::ops::Bound::*; let bound_string = Included("Hello, World!"); assert_eq!(bound_string.map(|s| s.len()), Included(13)); ``` ``` #![feature(bound_map)] use std::ops::Bound; use Bound::*; let unbounded_string: Bound<String> = Unbounded; assert_eq!(unbounded_string.map(|s| s.len()), Unbounded); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#734)### impl<T> Bound<&T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#748)1.55.0 · #### pub fn cloned(self) -> Bound<T> Map a `Bound<&T>` to a `Bound<T>` by cloning the contents of the bound. ##### Examples ``` use std::ops::Bound::*; use std::ops::RangeBounds; assert_eq!((1..12).start_bound(), Included(&1)); assert_eq!((1..12).start_bound().cloned(), Included(1)); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> Clone for Bound<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)#### fn clone(&self) -> Bound<T> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> Debug for Bound<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> Hash for Bound<T>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> PartialEq<Bound<T>> for Bound<T>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)#### fn eq(&self, other: &Bound<T>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> Copy for Bound<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> Eq for Bound<T>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> StructuralEq for Bound<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)### impl<T> StructuralPartialEq for Bound<T> Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Bound<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Bound<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Bound<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Bound<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Bound<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Trait std::ops::Try Trait std::ops::Try =================== ``` pub trait Try: FromResidual<Self::Residual> { type Output; type Residual; fn from_output(output: Self::Output) -> Self; fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; } ``` 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The `?` operator and `try {}` blocks. `try_*` methods typically involve a type implementing this trait. For example, the closures passed to [`Iterator::try_fold`](../iter/trait.iterator#method.try_fold "Iterator::try_fold") and [`Iterator::try_for_each`](../iter/trait.iterator#method.try_for_each "Iterator::try_for_each") must return such a type. `Try` types are typically those containing two or more categories of values, some subset of which are so commonly handled via early returns that it’s worth providing a terse (but still visible) syntax to make that easy. This is most often seen for error handling with [`Result`](../result/enum.result "Result") and [`Option`](../option/enum.option "Option"). The quintessential implementation of this trait is on [`ControlFlow`](enum.controlflow "ControlFlow"). Using `Try` in Generic Code --------------------------- `Iterator::try_fold` was stabilized to call back in Rust 1.27, but this trait is much newer. To illustrate the various associated types and methods, let’s implement our own version. As a reminder, an infallible version of a fold looks something like this: ``` fn simple_fold<A, T>( iter: impl Iterator<Item = T>, mut accum: A, mut f: impl FnMut(A, T) -> A, ) -> A { for x in iter { accum = f(accum, x); } accum } ``` So instead of `f` returning just an `A`, we’ll need it to return some other type that produces an `A` in the “don’t short circuit” path. Conveniently, that’s also the type we need to return from the function. Let’s add a new generic parameter `R` for that type, and bound it to the output type that we want: ``` fn simple_try_fold_1<A, T, R: Try<Output = A>>( iter: impl Iterator<Item = T>, mut accum: A, mut f: impl FnMut(A, T) -> R, ) -> R { todo!() } ``` If we get through the entire iterator, we need to wrap up the accumulator into the return type using [`Try::from_output`](trait.try#tymethod.from_output "Try::from_output"): ``` fn simple_try_fold_2<A, T, R: Try<Output = A>>( iter: impl Iterator<Item = T>, mut accum: A, mut f: impl FnMut(A, T) -> R, ) -> R { for x in iter { let cf = f(accum, x).branch(); match cf { ControlFlow::Continue(a) => accum = a, ControlFlow::Break(_) => todo!(), } } R::from_output(accum) } ``` We’ll also need [`FromResidual::from_residual`](trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") to turn the residual back into the original type. But because it’s a supertrait of `Try`, we don’t need to mention it in the bounds. All types which implement `Try` can be recreated from their corresponding residual, so we’ll just call it: ``` pub fn simple_try_fold_3<A, T, R: Try<Output = A>>( iter: impl Iterator<Item = T>, mut accum: A, mut f: impl FnMut(A, T) -> R, ) -> R { for x in iter { let cf = f(accum, x).branch(); match cf { ControlFlow::Continue(a) => accum = a, ControlFlow::Break(r) => return R::from_residual(r), } } R::from_output(accum) } ``` But this “call `branch`, then `match` on it, and `return` if it was a `Break`” is exactly what happens inside the `?` operator. So rather than do all this manually, we can just use `?` instead: ``` fn simple_try_fold<A, T, R: Try<Output = A>>( iter: impl Iterator<Item = T>, mut accum: A, mut f: impl FnMut(A, T) -> R, ) -> R { for x in iter { accum = f(accum, x)?; } R::from_output(accum) } ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#134)#### type Output 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value produced by `?` when *not* short-circuiting. [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#158)#### type Residual 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value passed to [`FromResidual::from_residual`](trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") as part of `?` when short-circuiting. This represents the possible values of the `Self` type which are *not* represented by the `Output` type. ##### Note to Implementors The choice of this type is critical to interconversion. Unlike the `Output` type, which will often be a raw generic type, this type is typically a newtype of some sort to “color” the type so that it’s distinguishable from the residuals of other types. This is why `Result<T, E>::Residual` is not `E`, but `Result<Infallible, E>`. That way it’s distinct from `ControlFlow<E>::Residual`, for example, and thus `?` on `ControlFlow` cannot be used in a method returning `Result`. If you’re making a generic type `Foo<T>` that implements `Try<Output = T>`, then typically you can use `Foo<std::convert::Infallible>` as its `Residual` type: that type will have a “hole” in the correct place, and will maintain the “foo-ness” of the residual so other types need to opt-in to interconversion. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#190)#### fn from\_output(output: Self::Output) -> Self 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from its `Output` type. This should be implemented consistently with the `branch` method such that applying the `?` operator will get back the original value: `Try::from_output(x).branch() --> ControlFlow::Continue(x)`. ##### Examples ``` #![feature(try_trait_v2)] use std::ops::Try; assert_eq!(<Result<_, String> as Try>::from_output(3), Ok(3)); assert_eq!(<Option<_> as Try>::from_output(4), Some(4)); assert_eq!( <std::ops::ControlFlow<String, _> as Try>::from_output(5), std::ops::ControlFlow::Continue(5), ); assert_eq!(Option::from_output(4)?, 4); // This is used, for example, on the accumulator in `try_fold`: let r = std::iter::empty().try_fold(4, |_, ()| -> Option<_> { unreachable!() }); assert_eq!(r, Some(4)); ``` [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#217)#### fn branch(self) -> ControlFlow<Self::Residual, Self::Output> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used in `?` to decide whether the operator should produce a value (because this returned [`ControlFlow::Continue`](enum.controlflow#variant.Continue "ControlFlow::Continue")) or propagate a value back to the caller (because this returned [`ControlFlow::Break`](enum.controlflow#variant.Break "ControlFlow::Break")). ##### Examples ``` #![feature(try_trait_v2)] use std::ops::{ControlFlow, Try}; assert_eq!(Ok::<_, String>(3).branch(), ControlFlow::Continue(3)); assert_eq!(Err::<String, _>(3).branch(), ControlFlow::Break(Err(3))); assert_eq!(Some(3).branch(), ControlFlow::Continue(3)); assert_eq!(None::<String>.branch(), ControlFlow::Break(None)); assert_eq!(ControlFlow::<String, _>::Continue(3).branch(), ControlFlow::Continue(3)); assert_eq!( ControlFlow::<_, String>::Break(3).branch(), ControlFlow::Break(ControlFlow::Break(3)), ); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#98)### impl<B, C> Try for ControlFlow<B, C> #### type Output = C #### type Residual = ControlFlow<B, Infallible> [source](https://doc.rust-lang.org/src/core/option.rs.html#2286)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T> Try for Option<T> #### type Output = T #### type Residual = Option<Infallible> [source](https://doc.rust-lang.org/src/core/task/ready.rs.html#71)### impl<T> Try for Ready<T> #### type Output = T #### type Residual = Ready<Infallible> [source](https://doc.rust-lang.org/src/core/result.rs.html#2078)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · ### impl<T, E> Try for Result<T, E> #### type Output = T #### type Residual = Result<Infallible, E> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#290)### impl<T, E> Try for Poll<Option<Result<T, E>>> #### type Output = Poll<Option<T>> #### type Residual = Result<Infallible, E> [source](https://doc.rust-lang.org/src/core/task/poll.rs.html#260)### impl<T, E> Try for Poll<Result<T, E>> #### type Output = Poll<T> #### type Residual = Result<Infallible, E> rust Trait std::ops::Drop Trait std::ops::Drop ==================== ``` pub trait Drop { fn drop(&mut self); } ``` Custom code within the destructor. When a value is no longer needed, Rust will run a “destructor” on that value. The most common way that a value is no longer needed is when it goes out of scope. Destructors may still run in other circumstances, but we’re going to focus on scope for the examples here. To learn about some of those other cases, please see [the reference](../../reference/destructors) section on destructors. This destructor consists of two components: * A call to `Drop::drop` for that value, if this special `Drop` trait is implemented for its type. * The automatically generated “drop glue” which recursively calls the destructors of all the fields of this value. As Rust automatically calls the destructors of all contained fields, you don’t have to implement `Drop` in most cases. But there are some cases where it is useful, for example for types which directly manage a resource. That resource may be memory, it may be a file descriptor, it may be a network socket. Once a value of that type is no longer going to be used, it should “clean up” its resource by freeing the memory or closing the file or socket. This is the job of a destructor, and therefore the job of `Drop::drop`. ### Examples To see destructors in action, let’s take a look at the following program: ``` struct HasDrop; impl Drop for HasDrop { fn drop(&mut self) { println!("Dropping HasDrop!"); } } struct HasTwoDrops { one: HasDrop, two: HasDrop, } impl Drop for HasTwoDrops { fn drop(&mut self) { println!("Dropping HasTwoDrops!"); } } fn main() { let _x = HasTwoDrops { one: HasDrop, two: HasDrop }; println!("Running!"); } ``` Rust will first call `Drop::drop` for `_x` and then for both `_x.one` and `_x.two`, meaning that running this will print ``` Running! Dropping HasTwoDrops! Dropping HasDrop! Dropping HasDrop! ``` Even if we remove the implementation of `Drop` for `HasTwoDrop`, the destructors of its fields are still called. This would result in ``` Running! Dropping HasDrop! Dropping HasDrop! ``` ### You cannot call `Drop::drop` yourself Because `Drop::drop` is used to clean up a value, it may be dangerous to use this value after the method has been called. As `Drop::drop` does not take ownership of its input, Rust prevents misuse by not allowing you to call `Drop::drop` directly. In other words, if you tried to explicitly call `Drop::drop` in the above example, you’d get a compiler error. If you’d like to explicitly call the destructor of a value, [`mem::drop`](../mem/fn.drop) can be used instead. ### Drop order Which of our two `HasDrop` drops first, though? For structs, it’s the same order that they’re declared: first `one`, then `two`. If you’d like to try this yourself, you can modify `HasDrop` above to contain some data, like an integer, and then use it in the `println!` inside of `Drop`. This behavior is guaranteed by the language. Unlike for structs, local variables are dropped in reverse order: ``` struct Foo; impl Drop for Foo { fn drop(&mut self) { println!("Dropping Foo!") } } struct Bar; impl Drop for Bar { fn drop(&mut self) { println!("Dropping Bar!") } } fn main() { let _foo = Foo; let _bar = Bar; } ``` This will print ``` Dropping Bar! Dropping Foo! ``` Please see [the reference](../../reference/destructors) for the full rules. ### `Copy` and `Drop` are exclusive You cannot implement both [`Copy`](../marker/trait.copy "Copy") and `Drop` on the same type. Types that are `Copy` get implicitly duplicated by the compiler, making it very hard to predict when, and how often destructors will be executed. As such, these types cannot have destructors. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/drop.rs.html#164)#### fn drop(&mut self) Executes the destructor for this type. This method is called implicitly when the value goes out of scope, and cannot be called explicitly (this is compiler error [E0040](https://doc.rust-lang.org/error_codes/E0040.html)). However, the [`mem::drop`](../mem/fn.drop) function in the prelude can be used to call the argument’s `Drop` implementation. When this method has been called, `self` has not yet been deallocated. That only happens after the method is over. If this wasn’t the case, `self` would be a dangling reference. ##### Panics Given that a [`panic!`](https://doc.rust-lang.org/core/macro.panic.html) will call `drop` as it unwinds, any [`panic!`](https://doc.rust-lang.org/core/macro.panic.html) in a `drop` implementation will likely abort. Note that even if this panics, the value is considered to be dropped; you must not cause `drop` to be called again. This is normally automatically handled by the compiler, but when using unsafe code, can sometimes occur unintentionally, particularly when using [`ptr::drop_in_place`](../ptr/fn.drop_in_place). Implementors ------------ [source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#699)1.13.0 · ### impl Drop for CString [source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#167-179)1.63.0 · ### impl Drop for OwnedFd [source](https://doc.rust-lang.org/src/std/os/windows/io/handle.rs.html#364-371)1.63.0 · ### impl Drop for OwnedHandle Available on **Windows** only.[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#202-209)1.63.0 · ### impl Drop for OwnedSocket Available on **Windows** only.[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2881)1.6.0 · ### impl Drop for std::string::Drain<'\_> [source](https://doc.rust-lang.org/src/core/task/wake.rs.html#341)1.36.0 · ### impl Drop for Waker [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1529)### impl<'a, T> Drop for DrainSorted<'a, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#554)### impl<'f> Drop for VaListImpl<'f> [source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#54)1.21.0 · ### impl<I, A> Drop for Splice<'\_, I, A>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1639)1.7.0 · ### impl<K, V, A> Drop for std::collections::btree\_map::IntoIter<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#186)1.7.0 · ### impl<K, V, A> Drop for BTreeMap<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1846)### impl<K, V, F, A> Drop for std::collections::btree\_map::DrainFilter<'\_, K, V, F, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)K, [&mut](../primitive.reference) V) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#132)### impl<T> Drop for ThinBox<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#293)1.12.0 · ### impl<T> Drop for PeekMut<'\_, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1004)### impl<T> Drop for LinkedList<T> [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1528)### impl<T> Drop for Rc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2470)1.4.0 · ### impl<T> Drop for std::rc::Weak<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1501-1510)### impl<T> Drop for Receiver<T> [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#893-902)### impl<T> Drop for Sender<T> [source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1025-1029)### impl<T> Drop for SyncSender<T> [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#1636)### impl<T> Drop for Arc<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#429-438)### impl<T> Drop for OnceLock<T> [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2176)1.4.0 · ### impl<T> Drop for std::sync::Weak<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1236)### impl<T, A> Drop for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#137)### impl<T, A> Drop for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/drain.rs.html#65)1.6.0 · ### impl<T, A> Drop for std::collections::vec\_deque::Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#176)1.6.0 · ### impl<T, A> Drop for std::vec::Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#350)### impl<T, A> Drop for std::vec::IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2915)### impl<T, A> Drop for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1746)### impl<T, F> Drop for std::collections::linked\_list::DrainFilter<'\_, T, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1299)### impl<T, F, A> Drop for std::collections::btree\_set::DrainFilter<'\_, T, F, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#154)### impl<T, F, A> Drop for std::vec::DrainFilter<'\_, T, F, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool), [source](https://doc.rust-lang.org/src/core/array/iter.rs.html#363)1.40.0 · ### impl<T, const N: usize> Drop for std::array::IntoIter<T, N> [source](https://doc.rust-lang.org/src/std/sync/mutex.rs.html#524-532)### impl<T: ?Sized> Drop for MutexGuard<'\_, T> [source](https://doc.rust-lang.org/src/std/sync/rwlock.rs.html#599-606)### impl<T: ?Sized> Drop for RwLockReadGuard<'\_, T> [source](https://doc.rust-lang.org/src/std/sync/rwlock.rs.html#609-617)### impl<T: ?Sized> Drop for RwLockWriteGuard<'\_, T> [source](https://doc.rust-lang.org/src/std/io/buffered/bufwriter.rs.html#667-674)### impl<W: Write> Drop for BufWriter<W>
programming_docs
rust Trait std::ops::DivAssign Trait std::ops::DivAssign ========================= ``` pub trait DivAssign<Rhs = Self> { fn div_assign(&mut self, rhs: Rhs); } ``` The division assignment operator `/=`. Examples -------- ``` use std::ops::DivAssign; #[derive(Debug, PartialEq)] struct Frequency { hertz: f64 } impl DivAssign<f64> for Frequency { fn div_assign(&mut self, rhs: f64) { self.hertz /= rhs; } } let mut frequency = Frequency { hertz: 200.0 }; frequency /= 4.0; assert_eq!(Frequency { hertz: 50.0 }, frequency); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#952)#### fn div\_assign(&mut self, rhs: Rhs) Performs the `/=` operation. ##### Example ``` let mut x: u32 = 12; x /= 2; assert_eq!(x, 6); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl DivAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/time.rs.html#976)1.9.0 · ### impl DivAssign<u32> for Duration [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl DivAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl DivAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl DivAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> DivAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Div](trait.div "trait std::ops::Div")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Div](trait.div "trait std::ops::Div")<U>>::[Output](trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Trait std::ops::BitXorAssign Trait std::ops::BitXorAssign ============================ ``` pub trait BitXorAssign<Rhs = Self> { fn bitxor_assign(&mut self, rhs: Rhs); } ``` The bitwise XOR assignment operator `^=`. Examples -------- ``` use std::ops::BitXorAssign; #[derive(Debug, PartialEq)] struct Personality { has_soul: bool, likes_knitting: bool, } impl BitXorAssign for Personality { fn bitxor_assign(&mut self, rhs: Self) { self.has_soul ^= rhs.has_soul; self.likes_knitting ^= rhs.likes_knitting; } } let mut personality = Personality { has_soul: false, likes_knitting: true }; personality ^= Personality { has_soul: true, likes_knitting: true }; assert_eq!(personality, Personality { has_soul: true, likes_knitting: false}); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#862)#### fn bitxor\_assign(&mut self, rhs: Rhs) Performs the `^=` operation. ##### Examples ``` let mut x = true; x ^= false; assert_eq!(x, true); let mut x = true; x ^= true; assert_eq!(x, false); let mut x: u8 = 5; x ^= 1; assert_eq!(x, 4); let mut x: u8 = 5; x ^= 2; assert_eq!(x, 7); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&bool> for bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitXorAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<bool> for bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#878)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXorAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXorAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXorAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> BitXorAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](trait.bitxor "trait std::ops::BitXor")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](trait.bitxor "trait std::ops::BitXor")<U>>::[Output](trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#512)### impl<T, const LANES: usize> BitXorAssign<bool> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#501)### impl<T, const LANES: usize> BitXorAssign<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"),
programming_docs
rust Struct std::ops::RangeFrom Struct std::ops::RangeFrom ========================== ``` pub struct RangeFrom<Idx> { pub start: Idx, } ``` A range only bounded inclusively below (`start..`). The `RangeFrom` `start..` contains all values with `x >= start`. *Note*: Overflow in the [`Iterator`](../iter/trait.iterator "Iterator") implementation (when the contained data type reaches its numerical limit) is allowed to panic, wrap, or saturate. This behavior is defined by the implementation of the [`Step`](../iter/trait.step) trait. For primitive integers, this follows the normal rules, and respects the overflow checks profile (panic in debug, wrap in release). Note also that overflow happens earlier than you might assume: the overflow happens in the call to `next` that yields the maximum value, as the range must be set to a state to yield the next value. Examples -------- The `start..` syntax is a `RangeFrom`: ``` assert_eq!((2..), std::ops::RangeFrom { start: 2 }); assert_eq!(2 + 3 + 4, (2..).take(3).sum()); ``` ``` let arr = [0, 1, 2, 3, 4]; assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]); assert_eq!(arr[ .. 3], [0, 1, 2 ]); assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); assert_eq!(arr[1.. ], [ 1, 2, 3, 4]); // This is a `RangeFrom` assert_eq!(arr[1.. 3], [ 1, 2 ]); assert_eq!(arr[1..=3], [ 1, 2, 3 ]); ``` Fields ------ `start: Idx`The lower bound of the range (inclusive). Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#202)### impl<Idx> RangeFrom<Idx>where Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#217-220)1.35.0 · #### pub fn contains<U>(&self, item: &U) -> boolwhere Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. ##### Examples ``` assert!(!(3..).contains(&2)); assert!( (3..).contains(&3)); assert!( (3..).contains(&1_000_000_000)); assert!( (0.0..).contains(&0.5)); assert!(!(0.0..).contains(&f32::NAN)); assert!(!(f32::NAN..).contains(&0.5)); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> Clone for RangeFrom<Idx>where Idx: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)#### fn clone(&self) -> RangeFrom<Idx> Notable traits for [RangeFrom](struct.rangefrom "struct std::ops::RangeFrom")<A> ``` impl<A> Iterator for RangeFrom<A>where     A: Step, type Item = A; ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#194)### impl<Idx> Debug for RangeFrom<Idx>where Idx: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#195)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> Hash for RangeFrom<Idx>where Idx: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#582)1.47.0 · ### impl Index<RangeFrom<usize>> for CStr #### type Output = CStr The returned type after indexing. [source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#585)#### fn index(&self, index: RangeFrom<usize>) -> &CStr Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2349)### impl Index<RangeFrom<usize>> for String #### type Output = str The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2353)#### fn index(&self, index: RangeFrom<usize>) -> &str Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2400)1.3.0 · ### impl IndexMut<RangeFrom<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2402)#### fn index\_mut(&mut self, index: RangeFrom<usize>) -> &mut str Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#859)### impl<A> Iterator for RangeFrom<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), #### type Item = A The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#863)#### fn next(&mut self) -> Option<A> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#869)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#874)#### fn nth(&mut self, n: usize) -> Option<A> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)#### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3312-3314)#### fn cycle(self) -> Cycle<Self>where Self: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Cycle](../iter/struct.cycle "struct std::iter::Cycle")<I> ``` impl<I> Iterator for Cycle<I>where     I: Clone + Iterator, type Item = <I as Iterator>::Item; ``` Repeats an iterator endlessly. [Read more](../iter/trait.iterator#method.cycle) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> PartialEq<RangeFrom<Idx>> for RangeFrom<Idx>where Idx: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)#### fn eq(&self, other: &RangeFrom<Idx>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#926)1.28.0 · ### impl<T> RangeBounds<T> for RangeFrom<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#927)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#930)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#840)1.28.0 · ### impl<T> RangeBounds<T> for RangeFrom<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#841)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#844)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#374)1.15.0 (const: unstable) · ### impl<T> SliceIndex<[T]> for RangeFrom<usize> #### type Output = [T] The output type returned by methods. [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#378)const: unstable · #### fn get(self, slice: &[T]) -> Option<&[T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#383)const: unstable · #### fn get\_mut(self, slice: &mut [T]) -> Option<&mut [T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#388)const: unstable · #### unsafe fn get\_unchecked(self, slice: \*const [T]) -> \*const [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#394)const: unstable · #### unsafe fn get\_unchecked\_mut(self, slice: \*mut [T]) -> \*mut [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#400)const: unstable · #### fn index(self, slice: &[T]) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#409)const: unstable · #### fn index\_mut(self, slice: &mut [T]) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#326)1.20.0 (const: unstable) · ### impl SliceIndex<str> for RangeFrom<usize> Implements substring slicing with syntax `&self[begin ..]` or `&mut self[begin ..]`. Returns a slice of the given string from the byte range [`begin`, `len`). Equivalent to `&self[begin .. len]` or `&mut self[begin .. len]`. This operation is *O*(1). Prior to 1.20.0, these indexing operations were still supported by direct implementation of `Index` and `IndexMut`. #### Panics Panics if `begin` does not point to the starting byte offset of a character (as defined by `is_char_boundary`), or if `begin > len`. #### type Output = str The output type returned by methods. [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#329)const: unstable · #### fn get( self, slice: &str) -> Option<&<RangeFrom<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#339)const: unstable · #### fn get\_mut( self, slice: &mut str) -> Option<&mut <RangeFrom<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#349)const: unstable · #### unsafe fn get\_unchecked( self, slice: \*const str) -> \*const <RangeFrom<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#358)const: unstable · #### unsafe fn get\_unchecked\_mut( self, slice: \*mut str) -> \*mut <RangeFrom<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#366)const: unstable · #### fn index(self, slice: &str) -> &<RangeFrom<usize> as SliceIndex<str>>::Output Notable traits for [RangeFrom](struct.rangefrom "struct std::ops::RangeFrom")<A> ``` impl<A> Iterator for RangeFrom<A>where     A: Step, type Item = A; ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#374)const: unstable · #### fn index\_mut( self, slice: &mut str) -> &mut <RangeFrom<usize> as SliceIndex<str>>::Output Notable traits for [RangeFrom](struct.rangefrom "struct std::ops::RangeFrom")<A> ``` impl<A> Iterator for RangeFrom<A>where     A: Step, type Item = A; ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> Eq for RangeFrom<Idx>where Idx: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#886)1.26.0 · ### impl<A> FusedIterator for RangeFrom<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#988)### impl<T> OneSidedRange<T> for RangeFrom<T>where [RangeFrom](struct.rangefrom "struct std::ops::RangeFrom")<T>: [RangeBounds](trait.rangebounds "trait std::ops::RangeBounds")<T>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> StructuralEq for RangeFrom<Idx> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> StructuralPartialEq for RangeFrom<Idx> [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#883)### impl<A> TrustedLen for RangeFrom<A>where A: [TrustedStep](../iter/trait.trustedstep "trait std::iter::TrustedStep"), Auto Trait Implementations -------------------------- ### impl<Idx> RefUnwindSafe for RangeFrom<Idx>where Idx: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> Send for RangeFrom<Idx>where Idx: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<Idx> Sync for RangeFrom<Idx>where Idx: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<Idx> Unpin for RangeFrom<Idx>where Idx: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<Idx> UnwindSafe for RangeFrom<Idx>where Idx: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Trait std::ops::FnOnce Trait std::ops::FnOnce ====================== ``` pub trait FnOnce<Args> { type Output; extern "rust-call" fn call_once(self, args: Args) -> Self::Output; } ``` The version of the call operator that takes a by-value receiver. Instances of `FnOnce` can be called, but might not be callable multiple times. Because of this, if the only thing known about a type is that it implements `FnOnce`, it can only be called once. `FnOnce` is implemented automatically by closures that might consume captured variables, as well as all types that implement [`FnMut`](trait.fnmut "FnMut"), e.g., (safe) [function pointers](../primitive.fn) (since `FnOnce` is a supertrait of [`FnMut`](trait.fnmut "FnMut")). Since both [`Fn`](trait.fn "Fn") and [`FnMut`](trait.fnmut "FnMut") are subtraits of `FnOnce`, any instance of [`Fn`](trait.fn "Fn") or [`FnMut`](trait.fnmut "FnMut") can be used where a `FnOnce` is expected. Use `FnOnce` as a bound when you want to accept a parameter of function-like type and only need to call it once. If you need to call the parameter repeatedly, use [`FnMut`](trait.fnmut "FnMut") as a bound; if you also need it to not mutate state, use [`Fn`](trait.fn "Fn"). See the [chapter on closures in *The Rust Programming Language*](../../book/ch13-01-closures) for some more information on this topic. Also of note is the special syntax for `Fn` traits (e.g. `Fn(usize, bool) -> usize`). Those interested in the technical details of this can refer to [the relevant section in the *Rustonomicon*](https://doc.rust-lang.org/nomicon/hrtb.html). Examples -------- ### Using a `FnOnce` parameter ``` fn consume_with_relish<F>(func: F) where F: FnOnce() -> String { // `func` consumes its captured variables, so it cannot be run more // than once. println!("Consumed: {}", func()); println!("Delicious!"); // Attempting to invoke `func()` again will throw a `use of moved // value` error for `func`. } let x = String::from("x"); let consume_and_return_x = move || x; consume_with_relish(consume_and_return_x); // `consume_and_return_x` can no longer be invoked at this point ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#244)1.12.0 · #### type Output The returned type after the call operator is used. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#248)#### extern "rust-call" fn call\_once(self, args: Args) -> Self::Output 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/101803 "Tracking issue for const_fn_trait_ref_impls") · ### impl<A, F> FnOnce<A> for &Fwhere F: [Fn](trait.fn "trait std::ops::Fn")<A> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Output = <F as FnOnce<A>>::Output [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#300)const: [unstable](https://github.com/rust-lang/rust/issues/101803 "Tracking issue for const_fn_trait_ref_impls") · ### impl<A, F> FnOnce<A> for &mut Fwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")<A> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Output = <F as FnOnce<A>>::Output [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1936)1.35.0 · ### impl<Args, F, A> FnOnce<Args> for Box<F, A>where F: [FnOnce](trait.fnonce "trait std::ops::FnOnce")<Args> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), #### type Output = <F as FnOnce<Args>>::Output [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#267)1.9.0 · ### impl<R, F> FnOnce() for AssertUnwindSafe<F>where F: [FnOnce](trait.fnonce "trait std::ops::FnOnce")() -> R, #### type Output = R rust Trait std::ops::Mul Trait std::ops::Mul =================== ``` pub trait Mul<Rhs = Self> { type Output; fn mul(self, rhs: Rhs) -> Self::Output; } ``` The multiplication operator `*`. Note that `Rhs` is `Self` by default, but this is not mandatory. Examples -------- ### `Mul`tipliable rational numbers ``` use std::ops::Mul; // By the fundamental theorem of arithmetic, rational numbers in lowest // terms are unique. So, by keeping `Rational`s in reduced form, we can // derive `Eq` and `PartialEq`. #[derive(Debug, Eq, PartialEq)] struct Rational { numerator: usize, denominator: usize, } impl Rational { fn new(numerator: usize, denominator: usize) -> Self { if denominator == 0 { panic!("Zero is an invalid denominator!"); } // Reduce to lowest terms by dividing by the greatest common // divisor. let gcd = gcd(numerator, denominator); Self { numerator: numerator / gcd, denominator: denominator / gcd, } } } impl Mul for Rational { // The multiplication of rational numbers is a closed operation. type Output = Self; fn mul(self, rhs: Self) -> Self { let numerator = self.numerator * rhs.numerator; let denominator = self.denominator * rhs.denominator; Self::new(numerator, denominator) } } // Euclid's two-thousand-year-old algorithm for finding the greatest common // divisor. fn gcd(x: usize, y: usize) -> usize { let mut x = x; let mut y = y; while y != 0 { let t = y; y = x % y; x = t; } x } assert_eq!(Rational::new(1, 2), Rational::new(2, 4)); assert_eq!(Rational::new(2, 3) * Rational::new(3, 4), Rational::new(1, 2)); ``` ### Multiplying vectors by scalars as in linear algebra ``` use std::ops::Mul; struct Scalar { value: usize } #[derive(Debug, PartialEq)] struct Vector { value: Vec<usize> } impl Mul<Scalar> for Vector { type Output = Self; fn mul(self, rhs: Scalar) -> Self::Output { Self { value: self.value.iter().map(|v| v * rhs.value).collect() } } } let vector = Vector { value: vec![2, 4, 6] }; let scalar = Scalar { value: 3 }; assert_eq!(vector * scalar, Vector { value: vec![6, 12, 18] }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#339)#### type Output The resulting type after applying the `*` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#350)#### fn mul(self, rhs: Rhs) -> Self::Output Performs the `*` operation. ##### Example ``` assert_eq!(12 * 2, 24); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&f32> for &f32 #### type Output = <f32 as Mul<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&f32> for f32 #### type Output = <f32 as Mul<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&f64> for &f64 #### type Output = <f64 as Mul<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&f64> for f64 #### type Output = <f64 as Mul<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i8> for &i8 #### type Output = <i8 as Mul<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i8> for i8 #### type Output = <i8 as Mul<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i16> for &i16 #### type Output = <i16 as Mul<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i16> for i16 #### type Output = <i16 as Mul<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i32> for &i32 #### type Output = <i32 as Mul<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i32> for i32 #### type Output = <i32 as Mul<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i64> for &i64 #### type Output = <i64 as Mul<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i64> for i64 #### type Output = <i64 as Mul<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i128> for &i128 #### type Output = <i128 as Mul<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&i128> for i128 #### type Output = <i128 as Mul<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&isize> for &isize #### type Output = <isize as Mul<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&isize> for isize #### type Output = <isize as Mul<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u8> for &u8 #### type Output = <u8 as Mul<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u8> for u8 #### type Output = <u8 as Mul<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u16> for &u16 #### type Output = <u16 as Mul<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u16> for u16 #### type Output = <u16 as Mul<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u32> for &u32 #### type Output = <u32 as Mul<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u32> for u32 #### type Output = <u32 as Mul<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u64> for &u64 #### type Output = <u64 as Mul<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u64> for u64 #### type Output = <u64 as Mul<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u128> for &u128 #### type Output = <u128 as Mul<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&u128> for u128 #### type Output = <u128 as Mul<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&usize> for &usize #### type Output = <usize as Mul<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<&usize> for usize #### type Output = <usize as Mul<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Mul<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Mul<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Mul<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Mul<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Mul<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Mul<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Mul<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Mul<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Mul<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Mul<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Mul<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Mul<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Mul<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Mul<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Mul<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Mul<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Mul<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Mul<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Mul<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Mul<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Mul<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Mul<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Mul<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl Mul<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Mul<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<f32> for f32 #### type Output = f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<f64> for f64 #### type Output = f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/time.rs.html#942)1.3.0 · ### impl Mul<u32> for Duration #### type Output = Duration [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Mul<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Mul<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/time.rs.html#951)1.31.0 · ### impl Mul<Duration> for u32 #### type Output = Duration [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<f32> for &'a f32 #### type Output = <f32 as Mul<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<f64> for &'a f64 #### type Output = <f64 as Mul<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<i8> for &'a i8 #### type Output = <i8 as Mul<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<i16> for &'a i16 #### type Output = <i16 as Mul<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<i32> for &'a i32 #### type Output = <i32 as Mul<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<i64> for &'a i64 #### type Output = <i64 as Mul<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<i128> for &'a i128 #### type Output = <i128 as Mul<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<isize> for &'a isize #### type Output = <isize as Mul<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<u8> for &'a u8 #### type Output = <u8 as Mul<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<u16> for &'a u16 #### type Output = <u16 as Mul<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<u32> for &'a u32 #### type Output = <u32 as Mul<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<u64> for &'a u64 #### type Output = <u64 as Mul<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<u128> for &'a u128 #### type Output = <u128 as Mul<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Mul<usize> for &'a usize #### type Output = <usize as Mul<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Mul<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Mul<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Mul<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Mul<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Mul<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Mul<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Mul<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Mul<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Mul<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Mul<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Mul<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Mul<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Mul<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Mul<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Mul<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Mul<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Mul<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Mul<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Mul<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Mul<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Mul<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Mul<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Mul<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Mul<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 · ### impl<'a> Mul<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Mul<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Mul<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](trait.mul "trait std::ops::Mul")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](trait.mul "trait std::ops::Mul")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Mul<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](trait.mul "trait std::ops::Mul")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](trait.mul "trait std::ops::Mul")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Mul<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Mul](trait.mul "trait std::ops::Mul")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Mul](trait.mul "trait std::ops::Mul")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.mul#associatedtype.Output "type std::ops::Mul::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Mul<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Mul<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Mul<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::Shr Trait std::ops::Shr =================== ``` pub trait Shr<Rhs = Self> { type Output; fn shr(self, rhs: Rhs) -> Self::Output; } ``` The right shift operator `>>`. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for `_ >> _`, setting the result type for integer operations to the type of the left-hand-side operand. This means that though `a >> b` and `a.shr(b)` are one and the same from an evaluation standpoint, they are different when it comes to type inference. Examples -------- An implementation of `Shr` that lifts the `>>` operation on integers to a wrapper around `usize`. ``` use std::ops::Shr; #[derive(PartialEq, Debug)] struct Scalar(usize); impl Shr<Scalar> for Scalar { type Output = Self; fn shr(self, Self(rhs): Self) -> Self::Output { let Self(lhs) = self; Self(lhs >> rhs) } } assert_eq!(Scalar(16) >> Scalar(2), Scalar(4)); ``` An implementation of `Shr` that spins a vector rightward by a given amount. ``` use std::ops::Shr; #[derive(PartialEq, Debug)] struct SpinVector<T: Clone> { vec: Vec<T>, } impl<T: Clone> Shr<usize> for SpinVector<T> { type Output = Self; fn shr(self, rhs: usize) -> Self::Output { // Rotate the vector by `rhs` places. let (a, b) = self.vec.split_at(self.vec.len() - rhs); let mut spun_vector = vec![]; spun_vector.extend_from_slice(b); spun_vector.extend_from_slice(a); Self { vec: spun_vector } } } assert_eq!(SpinVector { vec: vec![0, 1, 2, 3, 4] } >> 2, SpinVector { vec: vec![3, 4, 0, 1, 2] }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#570)#### type Output The resulting type after applying the `>>` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#582)#### fn shr(self, rhs: Rhs) -> Self::Output Performs the `>>` operation. ##### Examples ``` assert_eq!(5u8 >> 1, 2); assert_eq!(2u8 >> 1, 1); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &i8 #### type Output = <i8 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &i16 #### type Output = <i16 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &i32 #### type Output = <i32 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &i64 #### type Output = <i64 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &i128 #### type Output = <i128 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &isize #### type Output = <isize as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &u8 #### type Output = <u8 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &u16 #### type Output = <u16 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &u32 #### type Output = <u32 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &u64 #### type Output = <u64 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &u128 #### type Output = <u128 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for &usize #### type Output = <usize as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for i8 #### type Output = <i8 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for i16 #### type Output = <i16 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for i32 #### type Output = <i32 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for i64 #### type Output = <i64 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for i128 #### type Output = <i128 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for isize #### type Output = <isize as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for u8 #### type Output = <u8 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for u16 #### type Output = <u16 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for u32 #### type Output = <u32 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for u64 #### type Output = <u64 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for u128 #### type Output = <u128 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i8> for usize #### type Output = <usize as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &i8 #### type Output = <i8 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &i16 #### type Output = <i16 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &i32 #### type Output = <i32 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &i64 #### type Output = <i64 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &i128 #### type Output = <i128 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &isize #### type Output = <isize as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &u8 #### type Output = <u8 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &u16 #### type Output = <u16 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &u32 #### type Output = <u32 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &u64 #### type Output = <u64 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &u128 #### type Output = <u128 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for &usize #### type Output = <usize as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for i8 #### type Output = <i8 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for i16 #### type Output = <i16 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for i32 #### type Output = <i32 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for i64 #### type Output = <i64 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for i128 #### type Output = <i128 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for isize #### type Output = <isize as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for u8 #### type Output = <u8 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for u16 #### type Output = <u16 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for u32 #### type Output = <u32 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for u64 #### type Output = <u64 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for u128 #### type Output = <u128 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i16> for usize #### type Output = <usize as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &i8 #### type Output = <i8 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &i16 #### type Output = <i16 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &i32 #### type Output = <i32 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &i64 #### type Output = <i64 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &i128 #### type Output = <i128 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &isize #### type Output = <isize as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &u8 #### type Output = <u8 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &u16 #### type Output = <u16 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &u32 #### type Output = <u32 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &u64 #### type Output = <u64 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &u128 #### type Output = <u128 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for &usize #### type Output = <usize as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for i8 #### type Output = <i8 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for i16 #### type Output = <i16 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for i32 #### type Output = <i32 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for i64 #### type Output = <i64 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for i128 #### type Output = <i128 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for isize #### type Output = <isize as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for u8 #### type Output = <u8 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for u16 #### type Output = <u16 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for u32 #### type Output = <u32 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for u64 #### type Output = <u64 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for u128 #### type Output = <u128 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i32> for usize #### type Output = <usize as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &i8 #### type Output = <i8 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &i16 #### type Output = <i16 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &i32 #### type Output = <i32 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &i64 #### type Output = <i64 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &i128 #### type Output = <i128 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &isize #### type Output = <isize as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &u8 #### type Output = <u8 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &u16 #### type Output = <u16 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &u32 #### type Output = <u32 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &u64 #### type Output = <u64 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &u128 #### type Output = <u128 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for &usize #### type Output = <usize as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for i8 #### type Output = <i8 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for i16 #### type Output = <i16 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for i32 #### type Output = <i32 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for i64 #### type Output = <i64 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for i128 #### type Output = <i128 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for isize #### type Output = <isize as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for u8 #### type Output = <u8 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for u16 #### type Output = <u16 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for u32 #### type Output = <u32 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for u64 #### type Output = <u64 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for u128 #### type Output = <u128 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i64> for usize #### type Output = <usize as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &i8 #### type Output = <i8 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &i16 #### type Output = <i16 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &i32 #### type Output = <i32 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &i64 #### type Output = <i64 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &i128 #### type Output = <i128 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &isize #### type Output = <isize as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &u8 #### type Output = <u8 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &u16 #### type Output = <u16 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &u32 #### type Output = <u32 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &u64 #### type Output = <u64 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &u128 #### type Output = <u128 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for &usize #### type Output = <usize as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for i8 #### type Output = <i8 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for i16 #### type Output = <i16 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for i32 #### type Output = <i32 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for i64 #### type Output = <i64 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for i128 #### type Output = <i128 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for isize #### type Output = <isize as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for u8 #### type Output = <u8 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for u16 #### type Output = <u16 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for u32 #### type Output = <u32 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for u64 #### type Output = <u64 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for u128 #### type Output = <u128 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&i128> for usize #### type Output = <usize as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &i8 #### type Output = <i8 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &i16 #### type Output = <i16 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &i32 #### type Output = <i32 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &i64 #### type Output = <i64 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &i128 #### type Output = <i128 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &isize #### type Output = <isize as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &u8 #### type Output = <u8 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &u16 #### type Output = <u16 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &u32 #### type Output = <u32 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &u64 #### type Output = <u64 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &u128 #### type Output = <u128 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for &usize #### type Output = <usize as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for i8 #### type Output = <i8 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for i16 #### type Output = <i16 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for i32 #### type Output = <i32 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for i64 #### type Output = <i64 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for i128 #### type Output = <i128 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for isize #### type Output = <isize as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for u8 #### type Output = <u8 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for u16 #### type Output = <u16 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for u32 #### type Output = <u32 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for u64 #### type Output = <u64 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for u128 #### type Output = <u128 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&isize> for usize #### type Output = <usize as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &i8 #### type Output = <i8 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &i16 #### type Output = <i16 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &i32 #### type Output = <i32 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &i64 #### type Output = <i64 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &i128 #### type Output = <i128 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &isize #### type Output = <isize as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &u8 #### type Output = <u8 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &u16 #### type Output = <u16 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &u32 #### type Output = <u32 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &u64 #### type Output = <u64 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &u128 #### type Output = <u128 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for &usize #### type Output = <usize as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for i8 #### type Output = <i8 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for i16 #### type Output = <i16 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for i32 #### type Output = <i32 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for i64 #### type Output = <i64 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for i128 #### type Output = <i128 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for isize #### type Output = <isize as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for u8 #### type Output = <u8 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for u16 #### type Output = <u16 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for u32 #### type Output = <u32 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for u64 #### type Output = <u64 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for u128 #### type Output = <u128 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u8> for usize #### type Output = <usize as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &i8 #### type Output = <i8 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &i16 #### type Output = <i16 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &i32 #### type Output = <i32 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &i64 #### type Output = <i64 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &i128 #### type Output = <i128 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &isize #### type Output = <isize as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &u8 #### type Output = <u8 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &u16 #### type Output = <u16 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &u32 #### type Output = <u32 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &u64 #### type Output = <u64 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &u128 #### type Output = <u128 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for &usize #### type Output = <usize as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for i8 #### type Output = <i8 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for i16 #### type Output = <i16 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for i32 #### type Output = <i32 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for i64 #### type Output = <i64 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for i128 #### type Output = <i128 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for isize #### type Output = <isize as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for u8 #### type Output = <u8 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for u16 #### type Output = <u16 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for u32 #### type Output = <u32 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for u64 #### type Output = <u64 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for u128 #### type Output = <u128 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u16> for usize #### type Output = <usize as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &i8 #### type Output = <i8 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &i16 #### type Output = <i16 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &i32 #### type Output = <i32 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &i64 #### type Output = <i64 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &i128 #### type Output = <i128 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &isize #### type Output = <isize as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &u8 #### type Output = <u8 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &u16 #### type Output = <u16 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &u32 #### type Output = <u32 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &u64 #### type Output = <u64 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &u128 #### type Output = <u128 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for &usize #### type Output = <usize as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for i8 #### type Output = <i8 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for i16 #### type Output = <i16 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for i32 #### type Output = <i32 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for i64 #### type Output = <i64 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for i128 #### type Output = <i128 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for isize #### type Output = <isize as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for u8 #### type Output = <u8 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for u16 #### type Output = <u16 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for u32 #### type Output = <u32 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for u64 #### type Output = <u64 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for u128 #### type Output = <u128 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u32> for usize #### type Output = <usize as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &i8 #### type Output = <i8 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &i16 #### type Output = <i16 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &i32 #### type Output = <i32 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &i64 #### type Output = <i64 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &i128 #### type Output = <i128 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &isize #### type Output = <isize as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &u8 #### type Output = <u8 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &u16 #### type Output = <u16 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &u32 #### type Output = <u32 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &u64 #### type Output = <u64 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &u128 #### type Output = <u128 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for &usize #### type Output = <usize as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for i8 #### type Output = <i8 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for i16 #### type Output = <i16 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for i32 #### type Output = <i32 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for i64 #### type Output = <i64 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for i128 #### type Output = <i128 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for isize #### type Output = <isize as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for u8 #### type Output = <u8 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for u16 #### type Output = <u16 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for u32 #### type Output = <u32 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for u64 #### type Output = <u64 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for u128 #### type Output = <u128 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u64> for usize #### type Output = <usize as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &i8 #### type Output = <i8 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &i16 #### type Output = <i16 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &i32 #### type Output = <i32 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &i64 #### type Output = <i64 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &i128 #### type Output = <i128 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &isize #### type Output = <isize as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &u8 #### type Output = <u8 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &u16 #### type Output = <u16 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &u32 #### type Output = <u32 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &u64 #### type Output = <u64 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &u128 #### type Output = <u128 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for &usize #### type Output = <usize as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for i8 #### type Output = <i8 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for i16 #### type Output = <i16 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for i32 #### type Output = <i32 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for i64 #### type Output = <i64 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for i128 #### type Output = <i128 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for isize #### type Output = <isize as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for u8 #### type Output = <u8 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for u16 #### type Output = <u16 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for u32 #### type Output = <u32 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for u64 #### type Output = <u64 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for u128 #### type Output = <u128 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&u128> for usize #### type Output = <usize as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &i8 #### type Output = <i8 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &i16 #### type Output = <i16 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &i32 #### type Output = <i32 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &i64 #### type Output = <i64 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &i128 #### type Output = <i128 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &isize #### type Output = <isize as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &u8 #### type Output = <u8 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &u16 #### type Output = <u16 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &u32 #### type Output = <u32 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &u64 #### type Output = <u64 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &u128 #### type Output = <u128 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for &usize #### type Output = <usize as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i8> #### type Output = <Saturating<i8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i16> #### type Output = <Saturating<i16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i32> #### type Output = <Saturating<i32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i64> #### type Output = <Saturating<i64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<i128> #### type Output = <Saturating<i128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<isize> #### type Output = <Saturating<isize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u8> #### type Output = <Saturating<u8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u16> #### type Output = <Saturating<u16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u32> #### type Output = <Saturating<u32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u64> #### type Output = <Saturating<u64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<u128> #### type Output = <Saturating<u128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for &Saturating<usize> #### type Output = <Saturating<usize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for i8 #### type Output = <i8 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for i16 #### type Output = <i16 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for i32 #### type Output = <i32 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for i64 #### type Output = <i64 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for i128 #### type Output = <i128 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for isize #### type Output = <isize as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for u8 #### type Output = <u8 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for u16 #### type Output = <u16 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for u32 #### type Output = <u32 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for u64 #### type Output = <u64 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for u128 #### type Output = <u128 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<&usize> for usize #### type Output = <usize as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i8> #### type Output = <Saturating<i8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i16> #### type Output = <Saturating<i16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i32> #### type Output = <Saturating<i32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i64> #### type Output = <Saturating<i64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<i128> #### type Output = <Saturating<i128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<isize> #### type Output = <Saturating<isize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u8> #### type Output = <Saturating<u8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u16> #### type Output = <Saturating<u16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u32> #### type Output = <Saturating<u32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u64> #### type Output = <Saturating<u64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<u128> #### type Output = <Saturating<u128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<&usize> for Saturating<usize> #### type Output = <Saturating<usize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i8> #### type Output = <Wrapping<i8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i16> #### type Output = <Wrapping<i16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i32> #### type Output = <Wrapping<i32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i64> #### type Output = <Wrapping<i64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<i128> #### type Output = <Wrapping<i128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<isize> #### type Output = <Wrapping<isize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u8> #### type Output = <Wrapping<u8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u16> #### type Output = <Wrapping<u16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u32> #### type Output = <Wrapping<u32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u64> #### type Output = <Wrapping<u64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<u128> #### type Output = <Wrapping<u128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<&usize> for Wrapping<usize> #### type Output = <Wrapping<usize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i8> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i16> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i32> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i64> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<i128> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<isize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u8> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u16> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u32> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u64> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<u128> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shr<usize> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shr<usize> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a i8 #### type Output = <i8 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a i16 #### type Output = <i16 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a i32 #### type Output = <i32 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a i64 #### type Output = <i64 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a i128 #### type Output = <i128 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a isize #### type Output = <isize as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a u8 #### type Output = <u8 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a u16 #### type Output = <u16 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a u32 #### type Output = <u32 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a u64 #### type Output = <u64 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a u128 #### type Output = <u128 as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i8> for &'a usize #### type Output = <usize as Shr<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a i8 #### type Output = <i8 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a i16 #### type Output = <i16 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a i32 #### type Output = <i32 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a i64 #### type Output = <i64 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a i128 #### type Output = <i128 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a isize #### type Output = <isize as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a u8 #### type Output = <u8 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a u16 #### type Output = <u16 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a u32 #### type Output = <u32 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a u64 #### type Output = <u64 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a u128 #### type Output = <u128 as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i16> for &'a usize #### type Output = <usize as Shr<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a i8 #### type Output = <i8 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a i16 #### type Output = <i16 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a i32 #### type Output = <i32 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a i64 #### type Output = <i64 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a i128 #### type Output = <i128 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a isize #### type Output = <isize as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a u8 #### type Output = <u8 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a u16 #### type Output = <u16 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a u32 #### type Output = <u32 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a u64 #### type Output = <u64 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a u128 #### type Output = <u128 as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i32> for &'a usize #### type Output = <usize as Shr<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a i8 #### type Output = <i8 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a i16 #### type Output = <i16 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a i32 #### type Output = <i32 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a i64 #### type Output = <i64 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a i128 #### type Output = <i128 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a isize #### type Output = <isize as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a u8 #### type Output = <u8 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a u16 #### type Output = <u16 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a u32 #### type Output = <u32 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a u64 #### type Output = <u64 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a u128 #### type Output = <u128 as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i64> for &'a usize #### type Output = <usize as Shr<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a i8 #### type Output = <i8 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a i16 #### type Output = <i16 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a i32 #### type Output = <i32 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a i64 #### type Output = <i64 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a i128 #### type Output = <i128 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a isize #### type Output = <isize as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a u8 #### type Output = <u8 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a u16 #### type Output = <u16 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a u32 #### type Output = <u32 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a u64 #### type Output = <u64 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a u128 #### type Output = <u128 as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<i128> for &'a usize #### type Output = <usize as Shr<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a i8 #### type Output = <i8 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a i16 #### type Output = <i16 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a i32 #### type Output = <i32 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a i64 #### type Output = <i64 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a i128 #### type Output = <i128 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a isize #### type Output = <isize as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a u8 #### type Output = <u8 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a u16 #### type Output = <u16 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a u32 #### type Output = <u32 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a u64 #### type Output = <u64 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a u128 #### type Output = <u128 as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<isize> for &'a usize #### type Output = <usize as Shr<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a i8 #### type Output = <i8 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a i16 #### type Output = <i16 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a i32 #### type Output = <i32 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a i64 #### type Output = <i64 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a i128 #### type Output = <i128 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a isize #### type Output = <isize as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a u8 #### type Output = <u8 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a u16 #### type Output = <u16 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a u32 #### type Output = <u32 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a u64 #### type Output = <u64 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a u128 #### type Output = <u128 as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u8> for &'a usize #### type Output = <usize as Shr<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a i8 #### type Output = <i8 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a i16 #### type Output = <i16 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a i32 #### type Output = <i32 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a i64 #### type Output = <i64 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a i128 #### type Output = <i128 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a isize #### type Output = <isize as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a u8 #### type Output = <u8 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a u16 #### type Output = <u16 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a u32 #### type Output = <u32 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a u64 #### type Output = <u64 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a u128 #### type Output = <u128 as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u16> for &'a usize #### type Output = <usize as Shr<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a i8 #### type Output = <i8 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a i16 #### type Output = <i16 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a i32 #### type Output = <i32 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a i64 #### type Output = <i64 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a i128 #### type Output = <i128 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a isize #### type Output = <isize as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a u8 #### type Output = <u8 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a u16 #### type Output = <u16 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a u32 #### type Output = <u32 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a u64 #### type Output = <u64 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a u128 #### type Output = <u128 as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u32> for &'a usize #### type Output = <usize as Shr<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a i8 #### type Output = <i8 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a i16 #### type Output = <i16 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a i32 #### type Output = <i32 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a i64 #### type Output = <i64 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a i128 #### type Output = <i128 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a isize #### type Output = <isize as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a u8 #### type Output = <u8 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a u16 #### type Output = <u16 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a u32 #### type Output = <u32 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a u64 #### type Output = <u64 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a u128 #### type Output = <u128 as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u64> for &'a usize #### type Output = <usize as Shr<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a i8 #### type Output = <i8 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a i16 #### type Output = <i16 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a i32 #### type Output = <i32 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a i64 #### type Output = <i64 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a i128 #### type Output = <i128 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a isize #### type Output = <isize as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a u8 #### type Output = <u8 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a u16 #### type Output = <u16 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a u32 #### type Output = <u32 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a u64 #### type Output = <u64 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a u128 #### type Output = <u128 as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<u128> for &'a usize #### type Output = <usize as Shr<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a i8 #### type Output = <i8 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a i16 #### type Output = <i16 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a i32 #### type Output = <i32 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a i64 #### type Output = <i64 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a i128 #### type Output = <i128 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a isize #### type Output = <isize as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a u8 #### type Output = <u8 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a u16 #### type Output = <u16 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a u32 #### type Output = <u32 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a u64 #### type Output = <u64 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a u128 #### type Output = <u128 as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shr<usize> for &'a usize #### type Output = <usize as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shr<usize> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shr<usize> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Shr<usize>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Shr<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](trait.shr "trait std::ops::Shr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](trait.shr "trait std::ops::Shr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shr<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](trait.shr "trait std::ops::Shr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](trait.shr "trait std::ops::Shr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shr<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](trait.shr "trait std::ops::Shr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](trait.shr "trait std::ops::Shr")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shr<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::Fn Trait std::ops::Fn ================== ``` pub trait Fn<Args>: FnMut<Args> { extern "rust-call" fn call(&self, args: Args) -> Self::Output; } ``` The version of the call operator that takes an immutable receiver. Instances of `Fn` can be called repeatedly without mutating state. *This trait (`Fn`) is not to be confused with [function pointers](../primitive.fn) (`fn`).* `Fn` is implemented automatically by closures which only take immutable references to captured variables or don’t capture anything at all, as well as (safe) [function pointers](../primitive.fn) (with some caveats, see their documentation for more details). Additionally, for any type `F` that implements `Fn`, `&F` implements `Fn`, too. Since both [`FnMut`](trait.fnmut "FnMut") and [`FnOnce`](trait.fnonce "FnOnce") are supertraits of `Fn`, any instance of `Fn` can be used as a parameter where a [`FnMut`](trait.fnmut "FnMut") or [`FnOnce`](trait.fnonce "FnOnce") is expected. Use `Fn` as a bound when you want to accept a parameter of function-like type and need to call it repeatedly and without mutating state (e.g., when calling it concurrently). If you do not need such strict requirements, use [`FnMut`](trait.fnmut "FnMut") or [`FnOnce`](trait.fnonce "FnOnce") as bounds. See the [chapter on closures in *The Rust Programming Language*](../../book/ch13-01-closures) for some more information on this topic. Also of note is the special syntax for `Fn` traits (e.g. `Fn(usize, bool) -> usize`). Those interested in the technical details of this can refer to [the relevant section in the *Rustonomicon*](https://doc.rust-lang.org/nomicon/hrtb.html). Examples -------- ### Calling a closure ``` let square = |x| x * x; assert_eq!(square(5), 25); ``` ### Using a `Fn` parameter ``` fn call_with_one<F>(func: F) -> usize where F: Fn(usize) -> usize { func(1) } let double = |x| x * 2; assert_eq!(call_with_one(double), 2); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#77)#### extern "rust-call" fn call(&self, args: Args) -> Self::Output 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#254)const: [unstable](https://github.com/rust-lang/rust/issues/101803 "Tracking issue for const_fn_trait_ref_impls") · ### impl<A, F> Fn<A> for &Fwhere F: [Fn](trait.fn "trait std::ops::Fn")<A> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1952)1.35.0 · ### impl<Args, F, A> Fn<Args> for Box<F, A>where F: [Fn](trait.fn "trait std::ops::Fn")<Args> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), rust Trait std::ops::AddAssign Trait std::ops::AddAssign ========================= ``` pub trait AddAssign<Rhs = Self> { fn add_assign(&mut self, rhs: Rhs); } ``` The addition assignment operator `+=`. Examples -------- This example creates a `Point` struct that implements the `AddAssign` trait, and then demonstrates add-assigning to a mutable `Point`. ``` use std::ops::AddAssign; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl AddAssign for Point { fn add_assign(&mut self, other: Self) { *self = Self { x: self.x + other.x, y: self.y + other.y, }; } } let mut point = Point { x: 1, y: 0 }; point += Point { x: 2, y: 3 }; assert_eq!(point, Point { x: 3, y: 3 }); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#769)#### fn add\_assign(&mut self, rhs: Rhs) Performs the `+=` operation. ##### Example ``` let mut x: u32 = 12; x += 1; assert_eq!(x, 13); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2323)1.12.0 · ### impl AddAssign<&str> for String Implements the `+=` operator for appending to a `String`. This has the same behavior as the [`push_str`](../string/struct.string#method.push_str "String::push_str") method. [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl AddAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl AddAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl AddAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl AddAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/time.rs.html#919)1.9.0 · ### impl AddAssign<Duration> for Duration [source](https://doc.rust-lang.org/src/std/time.rs.html#413-417)1.9.0 · ### impl AddAssign<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#589-593)1.9.0 · ### impl AddAssign<Duration> for SystemTime [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#465)1.14.0 · ### impl<'a> AddAssign<&'a str> for Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#482)1.14.0 · ### impl<'a> AddAssign<Cow<'a, str>> for Cow<'a, str> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> AddAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Add](trait.add "trait std::ops::Add")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Add](trait.add "trait std::ops::Add")<U>>::[Output](trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Struct std::ops::RangeTo Struct std::ops::RangeTo ======================== ``` pub struct RangeTo<Idx> { pub end: Idx, } ``` A range only bounded exclusively above (`..end`). The `RangeTo` `..end` contains all values with `x < end`. It cannot serve as an [`Iterator`](../iter/trait.iterator "Iterator") because it doesn’t have a starting point. Examples -------- The `..end` syntax is a `RangeTo`: ``` assert_eq!((..5), std::ops::RangeTo { end: 5 }); ``` It does not have an [`IntoIterator`](../iter/trait.intoiterator "IntoIterator") implementation, so you can’t use it in a `for` loop directly. This won’t compile: ⓘ ``` // error[E0277]: the trait bound `std::ops::RangeTo<{integer}>: // std::iter::Iterator` is not satisfied for i in ..5 { // ... } ``` When used as a [slicing index](../slice/trait.sliceindex), `RangeTo` produces a slice of all array elements before the index indicated by `end`. ``` let arr = [0, 1, 2, 3, 4]; assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]); assert_eq!(arr[ .. 3], [0, 1, 2 ]); // This is a `RangeTo` assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); assert_eq!(arr[1.. ], [ 1, 2, 3, 4]); assert_eq!(arr[1.. 3], [ 1, 2 ]); assert_eq!(arr[1..=3], [ 1, 2, 3 ]); ``` Fields ------ `end: Idx`The upper bound of the range (exclusive). Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#283)### impl<Idx> RangeTo<Idx>where Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#298-301)1.35.0 · #### pub fn contains<U>(&self, item: &U) -> boolwhere Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. ##### Examples ``` assert!( (..5).contains(&-1_000_000_000)); assert!( (..5).contains(&4)); assert!(!(..5).contains(&5)); assert!( (..1.0).contains(&0.5)); assert!(!(..1.0).contains(&f32::NAN)); assert!(!(..f32::NAN).contains(&0.5)); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> Clone for RangeTo<Idx>where Idx: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)#### fn clone(&self) -> RangeTo<Idx> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#275)### impl<Idx> Debug for RangeTo<Idx>where Idx: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#276)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> Hash for RangeTo<Idx>where Idx: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2340)### impl Index<RangeTo<usize>> for String #### type Output = str The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2344)#### fn index(&self, index: RangeTo<usize>) -> &str Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2393)1.3.0 · ### impl IndexMut<RangeTo<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2395)#### fn index\_mut(&mut self, index: RangeTo<usize>) -> &mut str Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> PartialEq<RangeTo<Idx>> for RangeTo<Idx>where Idx: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)#### fn eq(&self, other: &RangeTo<Idx>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#936)1.28.0 · ### impl<T> RangeBounds<T> for RangeTo<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#937)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#940)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#850)1.28.0 · ### impl<T> RangeBounds<T> for RangeTo<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#851)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#854)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#336)1.15.0 (const: unstable) · ### impl<T> SliceIndex<[T]> for RangeTo<usize> #### type Output = [T] The output type returned by methods. [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#340)const: unstable · #### fn get(self, slice: &[T]) -> Option<&[T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#345)const: unstable · #### fn get\_mut(self, slice: &mut [T]) -> Option<&mut [T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#350)const: unstable · #### unsafe fn get\_unchecked(self, slice: \*const [T]) -> \*const [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#356)const: unstable · #### unsafe fn get\_unchecked\_mut(self, slice: \*mut [T]) -> \*mut [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#362)const: unstable · #### fn index(self, slice: &[T]) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#367)const: unstable · #### fn index\_mut(self, slice: &mut [T]) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#255)1.20.0 (const: unstable) · ### impl SliceIndex<str> for RangeTo<usize> Implements substring slicing with syntax `&self[.. end]` or `&mut self[.. end]`. Returns a slice of the given string from the byte range [0, `end`). Equivalent to `&self[0 .. end]` or `&mut self[0 .. end]`. This operation is *O*(1). Prior to 1.20.0, these indexing operations were still supported by direct implementation of `Index` and `IndexMut`. #### Panics Panics if `end` does not point to the starting byte offset of a character (as defined by `is_char_boundary`), or if `end > len`. #### type Output = str The output type returned by methods. [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#258)const: unstable · #### fn get(self, slice: &str) -> Option<&<RangeTo<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#268)const: unstable · #### fn get\_mut( self, slice: &mut str) -> Option<&mut <RangeTo<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#278)const: unstable · #### unsafe fn get\_unchecked( self, slice: \*const str) -> \*const <RangeTo<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#284)const: unstable · #### unsafe fn get\_unchecked\_mut( self, slice: \*mut str) -> \*mut <RangeTo<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#290)const: unstable · #### fn index(self, slice: &str) -> &<RangeTo<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#298)const: unstable · #### fn index\_mut( self, slice: &mut str) -> &mut <RangeTo<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> Copy for RangeTo<Idx>where Idx: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> Eq for RangeTo<Idx>where Idx: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#985)### impl<T> OneSidedRange<T> for RangeTo<T>where [RangeTo](struct.rangeto "struct std::ops::RangeTo")<T>: [RangeBounds](trait.rangebounds "trait std::ops::RangeBounds")<T>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> StructuralEq for RangeTo<Idx> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> StructuralPartialEq for RangeTo<Idx> Auto Trait Implementations -------------------------- ### impl<Idx> RefUnwindSafe for RangeTo<Idx>where Idx: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> Send for RangeTo<Idx>where Idx: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<Idx> Sync for RangeTo<Idx>where Idx: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<Idx> Unpin for RangeTo<Idx>where Idx: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<Idx> UnwindSafe for RangeTo<Idx>where Idx: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Struct std::ops::Yeet Struct std::ops::Yeet ===================== ``` pub struct Yeet<T>(pub T); ``` 🔬This is a nightly-only experimental API. (`try_trait_v2_yeet` [#96374](https://github.com/rust-lang/rust/issues/96374)) Implement `FromResidual<Yeet<T>>` on your type to enable `do yeet expr` syntax in functions returning your type. Tuple Fields ------------ `0: T` 🔬This is a nightly-only experimental API. (`try_trait_v2_yeet` [#96374](https://github.com/rust-lang/rust/issues/96374)) Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#497)### impl<T> Debug for Yeet<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/try_trait.rs.html#497)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/option.rs.html#2316)### impl<T> FromResidual<Yeet<()>> for Option<T> [source](https://doc.rust-lang.org/src/core/option.rs.html#2318)#### fn from\_residual(Yeet<()>) -> Option<T> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/result.rs.html#2111)### impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>where F: [From](../convert/trait.from "trait std::convert::From")<E>, [source](https://doc.rust-lang.org/src/core/result.rs.html#2113)#### fn from\_residual(Yeet<E>) -> Result<T, F> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](trait.fromresidual#tymethod.from_residual) Auto Trait Implementations -------------------------- ### impl<T> RefUnwindSafe for Yeet<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<T> Send for Yeet<T>where T: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<T> Sync for Yeet<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<T> Unpin for Yeet<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<T> UnwindSafe for Yeet<T>where T: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::ops::Range Struct std::ops::Range ====================== ``` pub struct Range<Idx> { pub start: Idx, pub end: Idx, } ``` A (half-open) range bounded inclusively below and exclusively above (`start..end`). The range `start..end` contains all values with `start <= x < end`. It is empty if `start >= end`. Examples -------- The `start..end` syntax is a `Range`: ``` assert_eq!((3..5), std::ops::Range { start: 3, end: 5 }); assert_eq!(3 + 4 + 5, (3..6).sum()); ``` ``` let arr = [0, 1, 2, 3, 4]; assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]); assert_eq!(arr[ .. 3], [0, 1, 2 ]); assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); assert_eq!(arr[1.. ], [ 1, 2, 3, 4]); assert_eq!(arr[1.. 3], [ 1, 2 ]); // This is a `Range` assert_eq!(arr[1..=3], [ 1, 2, 3 ]); ``` Fields ------ `start: Idx`The lower bound of the range (inclusive). `end: Idx`The upper bound of the range (exclusive). Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#99)### impl<Idx> Range<Idx>where Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#119-122)1.35.0 · #### pub fn contains<U>(&self, item: &U) -> boolwhere Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. ##### Examples ``` assert!(!(3..5).contains(&2)); assert!( (3..5).contains(&3)); assert!( (3..5).contains(&4)); assert!(!(3..5).contains(&5)); assert!(!(3..3).contains(&3)); assert!(!(3..2).contains(&3)); assert!( (0.0..1.0).contains(&0.5)); assert!(!(0.0..1.0).contains(&f32::NAN)); assert!(!(0.0..f32::NAN).contains(&0.5)); assert!(!(f32::NAN..1.0).contains(&0.5)); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#145)1.47.0 · #### pub fn is\_empty(&self) -> bool Returns `true` if the range contains no items. ##### Examples ``` assert!(!(3..5).is_empty()); assert!( (3..3).is_empty()); assert!( (3..2).is_empty()); ``` The range is empty if either side is incomparable: ``` assert!(!(3.0..5.0).is_empty()); assert!( (3.0..f32::NAN).is_empty()); assert!( (f32::NAN..5.0).is_empty()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Clone for Range<Idx>where Idx: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)#### fn clone(&self) -> Range<Idx> Notable traits for [Range](struct.range "struct std::ops::Range")<A> ``` impl<A> Iterator for Range<A>where     A: Step, type Item = A; ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)#### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#90)### impl<Idx> Debug for Range<Idx>where Idx: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#91)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Default for Range<Idx>where Idx: [Default](../default/trait.default "trait std::default::Default"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)#### fn default() -> Range<Idx> Notable traits for [Range](struct.range "struct std::ops::Range")<A> ``` impl<A> Iterator for Range<A>where     A: Step, type Item = A; ``` Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#816)### impl<A> DoubleEndedIterator for Range<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#818)#### fn next\_back(&mut self) -> Option<A> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#823)#### fn nth\_back(&mut self, n: usize) -> Option<A> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#828)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#221-225)1.27.0 · #### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = B>, This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#292-295)1.27.0 · #### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<i16> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<i32> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<i8> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<isize> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<u16> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<u32> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<u8> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#775-785)### impl ExactSizeIterator for Range<usize> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)#### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Hash for Range<Idx>where Idx: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2331)### impl Index<Range<usize>> for String #### type Output = str The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2335)#### fn index(&self, index: Range<usize>) -> &str Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2386)1.3.0 · ### impl IndexMut<Range<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2388)#### fn index\_mut(&mut self, index: Range<usize>) -> &mut str Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#706)### impl<A> Iterator for Range<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), #### type Item = A The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#710)#### fn next(&mut self) -> Option<A> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#715)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#725)#### fn nth(&mut self, n: usize) -> Option<A> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#730)#### fn last(self) -> Option<A> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#735)#### fn min(self) -> Option<A> Returns the minimum element of an iterator. [Read more](../iter/trait.iterator#method.min) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#740)#### fn max(self) -> Option<A> Returns the maximum element of an iterator. [Read more](../iter/trait.iterator#method.max) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#745)#### fn is\_sorted(self) -> bool 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted. [Read more](../iter/trait.iterator#method.is_sorted) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#750)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)#### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)#### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)#### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)#### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)#### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)#### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)#### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)#### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)#### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)#### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)#### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)#### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)#### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)#### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)#### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)#### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)#### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)#### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)#### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)#### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)#### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3312-3314)#### fn cycle(self) -> Cycle<Self>where Self: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Cycle](../iter/struct.cycle "struct std::iter::Cycle")<I> ``` impl<I> Iterator for Cycle<I>where     I: Clone + Iterator, type Item = <I as Iterator>::Item; ``` Repeats an iterator endlessly. [Read more](../iter/trait.iterator#method.cycle) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> PartialEq<Range<Idx>> for Range<Idx>where Idx: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)#### fn eq(&self, other: &Range<Idx>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)#### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#946)1.28.0 · ### impl<T> RangeBounds<T> for Range<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#947)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#950)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#860)1.28.0 · ### impl<T> RangeBounds<T> for Range<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#861)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#864)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#262)1.15.0 (const: unstable) · ### impl<T> SliceIndex<[T]> for Range<usize> #### type Output = [T] The output type returned by methods. [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#266)const: unstable · #### fn get(self, slice: &[T]) -> Option<&[T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#276)const: unstable · #### fn get\_mut(self, slice: &mut [T]) -> Option<&mut [T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#286)const: unstable · #### unsafe fn get\_unchecked(self, slice: \*const [T]) -> \*const [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#301)const: unstable · #### unsafe fn get\_unchecked\_mut(self, slice: \*mut [T]) -> \*mut [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#312)const: unstable · #### fn index(self, slice: &[T]) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#323)const: unstable · #### fn index\_mut(self, slice: &mut [T]) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#167)1.20.0 (const: unstable) · ### impl SliceIndex<str> for Range<usize> Implements substring slicing with syntax `&self[begin .. end]` or `&mut self[begin .. end]`. Returns a slice of the given string from the byte range [`begin`, `end`). This operation is *O*(1). Prior to 1.20.0, these indexing operations were still supported by direct implementation of `Index` and `IndexMut`. #### Panics Panics if `begin` or `end` does not point to the starting byte offset of a character (as defined by `is_char_boundary`), if `begin > end`, or if `end > len`. #### Examples ``` let s = "Löwe 老虎 Léopard"; assert_eq!(&s[0 .. 1], "L"); assert_eq!(&s[1 .. 9], "öwe 老"); // these will panic: // byte 2 lies within `ö`: // &s[2 ..3]; // byte 8 lies within `老` // &s[1 .. 8]; // byte 100 is outside the string // &s[3 .. 100]; ``` #### type Output = str The output type returned by methods. [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#170)const: unstable · #### fn get(self, slice: &str) -> Option<&<Range<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#184)const: unstable · #### fn get\_mut( self, slice: &mut str) -> Option<&mut <Range<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#197)const: unstable · #### unsafe fn get\_unchecked( self, slice: \*const str) -> \*const <Range<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#206)const: unstable · #### unsafe fn get\_unchecked\_mut( self, slice: \*mut str) -> \*mut <Range<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#214)const: unstable · #### fn index(self, slice: &str) -> &<Range<usize> as SliceIndex<str>>::Output Notable traits for [Range](struct.range "struct std::ops::Range")<A> ``` impl<A> Iterator for Range<A>where     A: Step, type Item = A; ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#222)const: unstable · #### fn index\_mut( self, slice: &mut str) -> &mut <Range<usize> as SliceIndex<str>>::Output Notable traits for [Range](struct.range "struct std::ops::Range")<A> ``` impl<A> Iterator for Range<A>where     A: Step, type Item = A; ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Eq for Range<Idx>where Idx: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#856)1.26.0 · ### impl<A> FusedIterator for Range<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> StructuralEq for Range<Idx> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> StructuralPartialEq for Range<Idx> [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#853)### impl<A> TrustedLen for Range<A>where A: [TrustedStep](../iter/trait.trustedstep "trait std::iter::TrustedStep"), Auto Trait Implementations -------------------------- ### impl<Idx> RefUnwindSafe for Range<Idx>where Idx: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> Send for Range<Idx>where Idx: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<Idx> Sync for Range<Idx>where Idx: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<Idx> Unpin for Range<Idx>where Idx: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<Idx> UnwindSafe for Range<Idx>where Idx: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Trait std::ops::BitXor Trait std::ops::BitXor ====================== ``` pub trait BitXor<Rhs = Self> { type Output; fn bitxor(self, rhs: Rhs) -> Self::Output; } ``` The bitwise XOR operator `^`. Note that `Rhs` is `Self` by default, but this is not mandatory. Examples -------- An implementation of `BitXor` that lifts `^` to a wrapper around `bool`. ``` use std::ops::BitXor; #[derive(Debug, PartialEq)] struct Scalar(bool); impl BitXor for Scalar { type Output = Self; // rhs is the "right-hand side" of the expression `a ^ b` fn bitxor(self, rhs: Self) -> Self::Output { Self(self.0 ^ rhs.0) } } assert_eq!(Scalar(true) ^ Scalar(true), Scalar(false)); assert_eq!(Scalar(true) ^ Scalar(false), Scalar(true)); assert_eq!(Scalar(false) ^ Scalar(true), Scalar(true)); assert_eq!(Scalar(false) ^ Scalar(false), Scalar(false)); ``` An implementation of `BitXor` trait for a wrapper around `Vec<bool>`. ``` use std::ops::BitXor; #[derive(Debug, PartialEq)] struct BooleanVector(Vec<bool>); impl BitXor for BooleanVector { type Output = Self; fn bitxor(self, Self(rhs): Self) -> Self::Output { let Self(lhs) = self; assert_eq!(lhs.len(), rhs.len()); Self( lhs.iter() .zip(rhs.iter()) .map(|(x, y)| *x ^ *y) .collect() ) } } let bv1 = BooleanVector(vec![true, true, false, false]); let bv2 = BooleanVector(vec![true, false, true, false]); let expected = BooleanVector(vec![false, true, true, false]); assert_eq!(bv1 ^ bv2, expected); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#351)#### type Output The resulting type after applying the `^` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#365)#### fn bitxor(self, rhs: Rhs) -> Self::Output Performs the `^` operation. ##### Examples ``` assert_eq!(true ^ false, true); assert_eq!(true ^ true, false); assert_eq!(5u8 ^ 1u8, 4); assert_eq!(5u8 ^ 2u8, 7); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&bool> for &bool #### type Output = <bool as BitXor<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&bool> for bool #### type Output = <bool as BitXor<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i8> for &i8 #### type Output = <i8 as BitXor<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i8> for i8 #### type Output = <i8 as BitXor<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i16> for &i16 #### type Output = <i16 as BitXor<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i16> for i16 #### type Output = <i16 as BitXor<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i32> for &i32 #### type Output = <i32 as BitXor<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i32> for i32 #### type Output = <i32 as BitXor<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i64> for &i64 #### type Output = <i64 as BitXor<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i64> for i64 #### type Output = <i64 as BitXor<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i128> for &i128 #### type Output = <i128 as BitXor<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&i128> for i128 #### type Output = <i128 as BitXor<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&isize> for &isize #### type Output = <isize as BitXor<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&isize> for isize #### type Output = <isize as BitXor<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u8> for &u8 #### type Output = <u8 as BitXor<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u8> for u8 #### type Output = <u8 as BitXor<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u16> for &u16 #### type Output = <u16 as BitXor<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u16> for u16 #### type Output = <u16 as BitXor<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u32> for &u32 #### type Output = <u32 as BitXor<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u32> for u32 #### type Output = <u32 as BitXor<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u64> for &u64 #### type Output = <u64 as BitXor<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u64> for u64 #### type Output = <u64 as BitXor<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u128> for &u128 #### type Output = <u128 as BitXor<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&u128> for u128 #### type Output = <u128 as BitXor<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&usize> for &usize #### type Output = <usize as BitXor<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<&usize> for usize #### type Output = <usize as BitXor<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<bool> for bool #### type Output = bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitXor<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitXor<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<bool> for &'a bool #### type Output = <bool as BitXor<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<i8> for &'a i8 #### type Output = <i8 as BitXor<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<i16> for &'a i16 #### type Output = <i16 as BitXor<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<i32> for &'a i32 #### type Output = <i32 as BitXor<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<i64> for &'a i64 #### type Output = <i64 as BitXor<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<i128> for &'a i128 #### type Output = <i128 as BitXor<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<isize> for &'a isize #### type Output = <isize as BitXor<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<u8> for &'a u8 #### type Output = <u8 as BitXor<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<u16> for &'a u16 #### type Output = <u16 as BitXor<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<u32> for &'a u32 #### type Output = <u32 as BitXor<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<u64> for &'a u64 #### type Output = <u64 as BitXor<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<u128> for &'a u128 #### type Output = <u128 as BitXor<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitXor<usize> for &'a usize #### type Output = <usize as BitXor<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as BitXor<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as BitXor<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as BitXor<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as BitXor<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as BitXor<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as BitXor<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as BitXor<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as BitXor<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as BitXor<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as BitXor<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as BitXor<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitXor<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as BitXor<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as BitXor<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as BitXor<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as BitXor<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as BitXor<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as BitXor<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as BitXor<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as BitXor<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as BitXor<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as BitXor<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as BitXor<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as BitXor<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitXor<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as BitXor<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> BitXor<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](trait.bitxor "trait std::ops::BitXor")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](trait.bitxor "trait std::ops::BitXor")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1404)### impl<T, A> BitXor<&BTreeSet<T, A>> for &BTreeSet<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Output = BTreeSet<T, A> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1189-1219)### impl<T, S> BitXor<&HashSet<T, S>> for &HashSet<T, S>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Clone](../clone/trait.clone "trait std::clone::Clone"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher") + [Default](../default/trait.default "trait std::default::Default"), #### type Output = HashSet<T, S> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitXor<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](trait.bitxor "trait std::ops::BitXor")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](trait.bitxor "trait std::ops::BitXor")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#418)### impl<T, const LANES: usize> BitXor<bool> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#431)### impl<T, const LANES: usize> BitXor<Mask<T, LANES>> for boolwhere T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#405)### impl<T, const LANES: usize> BitXor<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitXor<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitXor](trait.bitxor "trait std::ops::BitXor")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitXor](trait.bitxor "trait std::ops::BitXor")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitxor#associatedtype.Output "type std::ops::BitXor::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitXor<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::DispatchFromDyn Trait std::ops::DispatchFromDyn =============================== ``` pub trait DispatchFromDyn<T> { } ``` 🔬This is a nightly-only experimental API. (`dispatch_from_dyn`) `DispatchFromDyn` is used in the implementation of object safety checks (specifically allowing arbitrary self types), to guarantee that a method’s receiver type can be dispatched on. Note: `DispatchFromDyn` was briefly named `CoerceSized` (and had a slightly different interpretation). Imagine we have a trait object `t` with type `&dyn Tr`, where `Tr` is some trait with a method `m` defined as `fn m(&self);`. When calling `t.m()`, the receiver `t` is a wide pointer, but an implementation of `m` will expect a narrow pointer as `&self` (a reference to the concrete type). The compiler must generate an implicit conversion from the trait object/wide pointer to the concrete reference/narrow pointer. Implementing `DispatchFromDyn` indicates that that conversion is allowed and thus that the type implementing `DispatchFromDyn` is safe to use as the self type in an object-safe method. (in the above example, the compiler will require `DispatchFromDyn` is implemented for `&'a U`). `DispatchFromDyn` does not specify the conversion from wide pointer to narrow pointer; the conversion is hard-wired into the compiler. For the conversion to work, the following properties must hold (i.e., it is only safe to implement `DispatchFromDyn` for types which have these properties, these are also checked by the compiler): * EITHER `Self` and `T` are either both references or both raw pointers; in either case, with the same mutability. * OR, all of the following hold + `Self` and `T` must have the same type constructor, and only vary in a single type parameter formal (the *coerced type*, e.g., `impl DispatchFromDyn<Rc<T>> for Rc<U>` is ok and the single type parameter (instantiated with `T` or `U`) is the coerced type, `impl DispatchFromDyn<Arc<T>> for Rc<U>` is not ok). + The definition for `Self` must be a struct. + The definition for `Self` must not be `#[repr(packed)]` or `#[repr(C)]`. + Other than one-aligned, zero-sized fields, the definition for `Self` must have exactly one field and that field’s type must be the coerced type. Furthermore, `Self`’s field type must implement `DispatchFromDyn<F>` where `F` is the type of `T`’s field type. An example implementation of the trait: ``` impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Rc<U>> for Rc<T> where T: Unsize<U>, {} ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#123)### impl<'a, T, U> DispatchFromDyn<&'a U> for &'a Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#126)### impl<'a, T, U> DispatchFromDyn<&'a mut U> for &'a mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/pin.rs.html#918)1.33.0 · ### impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P>where P: [DispatchFromDyn](trait.dispatchfromdyn "trait std::ops::DispatchFromDyn")<U>, [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#129)### impl<T, U> DispatchFromDyn<\*const U> for \*const Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/unsize.rs.html#132)### impl<T, U> DispatchFromDyn<\*mut U> for \*mut Twhere T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1962)### impl<T, U> DispatchFromDyn<Box<U, Global>> for Box<T, Global>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#715)### impl<T, U> DispatchFromDyn<NonNull<U>> for NonNull<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#334)### impl<T, U> DispatchFromDyn<Rc<U>> for Rc<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2165)### impl<T, U> DispatchFromDyn<Weak<U>> for std::rc::Weak<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#252)### impl<T, U> DispatchFromDyn<Arc<U>> for Arc<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/sync.rs.html#303)### impl<T, U> DispatchFromDyn<Weak<U>> for std::sync::Weak<T>where T: [Unsize](../marker/trait.unsize "trait std::marker::Unsize")<U> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), U: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), rust Trait std::ops::RemAssign Trait std::ops::RemAssign ========================= ``` pub trait RemAssign<Rhs = Self> { fn rem_assign(&mut self, rhs: Rhs); } ``` The remainder assignment operator `%=`. Examples -------- ``` use std::ops::RemAssign; struct CookieJar { cookies: u32 } impl RemAssign<u32> for CookieJar { fn rem_assign(&mut self, piles: u32) { self.cookies %= piles; } } let mut jar = CookieJar { cookies: 31 }; let piles = 4; println!("Splitting up {} cookies into {} even piles!", jar.cookies, piles); jar %= piles; println!("{} cookies remain in the cookie jar!", jar.cookies); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1013)#### fn rem\_assign(&mut self, rhs: Rhs) Performs the `%=` operation. ##### Example ``` let mut x: u32 = 12; x %= 10; assert_eq!(x, 2); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl RemAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl RemAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl RemAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl RemAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> RemAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](trait.rem "trait std::ops::Rem")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](trait.rem "trait std::ops::Rem")<U>>::[Output](trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Trait std::ops::RangeBounds Trait std::ops::RangeBounds =========================== ``` pub trait RangeBounds<T>where    T: ?Sized,{ fn start_bound(&self) -> Bound<&T>; fn end_bound(&self) -> Bound<&T>; fn contains<U>(&self, item: &U) -> bool    where        T: PartialOrd<U>,        U: PartialOrd<T> + ?Sized, { ... } } ``` `RangeBounds` is implemented by Rust’s built-in range types, produced by range syntax like `..`, `a..`, `..b`, `..=c`, `d..e`, or `f..=g`. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#777)#### fn start\_bound(&self) -> Bound<&T> Start index bound. Returns the start value as a `Bound`. ##### Examples ``` use std::ops::Bound::*; use std::ops::RangeBounds; assert_eq!((..10).start_bound(), Unbounded); assert_eq!((3..10).start_bound(), Included(&3)); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#795)#### fn end\_bound(&self) -> Bound<&T> End index bound. Returns the end value as a `Bound`. ##### Examples ``` use std::ops::Bound::*; use std::ops::RangeBounds; assert_eq!((3..).end_bound(), Unbounded); assert_eq!((3..10).end_bound(), Excluded(&10)); ``` Provided Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. ##### Examples ``` assert!( (3..5).contains(&4)); assert!(!(3..5).contains(&2)); assert!( (0.0..1.0).contains(&0.5)); assert!(!(0.0..1.0).contains(&f32::NAN)); assert!(!(0.0..f32::NAN).contains(&0.5)); assert!(!(f32::NAN..1.0).contains(&0.5)); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#915)### impl<'a, T> RangeBounds<T> for (Bound<&'a T>, Bound<&'a T>)where T: 'a + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#896)### impl<T> RangeBounds<T> for (Bound<T>, Bound<T>) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#946)### impl<T> RangeBounds<T> for Range<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#860)### impl<T> RangeBounds<T> for Range<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#926)### impl<T> RangeBounds<T> for RangeFrom<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#840)### impl<T> RangeBounds<T> for RangeFrom<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#830)### impl<T> RangeBounds<T> for RangeFullwhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#956)### impl<T> RangeBounds<T> for RangeInclusive<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#870)### impl<T> RangeBounds<T> for RangeInclusive<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#936)### impl<T> RangeBounds<T> for RangeTo<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#850)### impl<T> RangeBounds<T> for RangeTo<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#966)### impl<T> RangeBounds<T> for RangeToInclusive<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#886)### impl<T> RangeBounds<T> for RangeToInclusive<T> rust Trait std::ops::BitAndAssign Trait std::ops::BitAndAssign ============================ ``` pub trait BitAndAssign<Rhs = Self> { fn bitand_assign(&mut self, rhs: Rhs); } ``` The bitwise AND assignment operator `&=`. Examples -------- An implementation of `BitAndAssign` that lifts the `&=` operator to a wrapper around `bool`. ``` use std::ops::BitAndAssign; #[derive(Debug, PartialEq)] struct Scalar(bool); impl BitAndAssign for Scalar { // rhs is the "right-hand side" of the expression `a &= b` fn bitand_assign(&mut self, rhs: Self) { *self = Self(self.0 & rhs.0) } } let mut scalar = Scalar(true); scalar &= Scalar(true); assert_eq!(scalar, Scalar(true)); let mut scalar = Scalar(true); scalar &= Scalar(false); assert_eq!(scalar, Scalar(false)); let mut scalar = Scalar(false); scalar &= Scalar(true); assert_eq!(scalar, Scalar(false)); let mut scalar = Scalar(false); scalar &= Scalar(false); assert_eq!(scalar, Scalar(false)); ``` Here, the `BitAndAssign` trait is implemented for a wrapper around `Vec<bool>`. ``` use std::ops::BitAndAssign; #[derive(Debug, PartialEq)] struct BooleanVector(Vec<bool>); impl BitAndAssign for BooleanVector { // `rhs` is the "right-hand side" of the expression `a &= b`. fn bitand_assign(&mut self, rhs: Self) { assert_eq!(self.0.len(), rhs.0.len()); *self = Self( self.0 .iter() .zip(rhs.0.iter()) .map(|(x, y)| *x & *y) .collect() ); } } let mut bv = BooleanVector(vec![true, true, false, false]); bv &= BooleanVector(vec![true, false, true, false]); let expected = BooleanVector(vec![true, false, false, false]); assert_eq!(bv, expected); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#718)#### fn bitand\_assign(&mut self, rhs: Rhs) Performs the `&=` operation. ##### Examples ``` let mut x = true; x &= false; assert_eq!(x, false); let mut x = true; x &= true; assert_eq!(x, true); let mut x: u8 = 5; x &= 1; assert_eq!(x, 1); let mut x: u8 = 5; x &= 2; assert_eq!(x, 0); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&bool> for bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitAndAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<bool> for bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#734)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAndAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAndAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAndAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> BitAndAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](trait.bitand "trait std::ops::BitAnd")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](trait.bitand "trait std::ops::BitAnd")<U>>::[Output](trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#468)### impl<T, const LANES: usize> BitAndAssign<bool> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#457)### impl<T, const LANES: usize> BitAndAssign<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"),
programming_docs
rust Trait std::ops::Neg Trait std::ops::Neg =================== ``` pub trait Neg { type Output; fn neg(self) -> Self::Output; } ``` The unary negation operator `-`. Examples -------- An implementation of `Neg` for `Sign`, which allows the use of `-` to negate its value. ``` use std::ops::Neg; #[derive(Debug, PartialEq)] enum Sign { Negative, Zero, Positive, } impl Neg for Sign { type Output = Self; fn neg(self) -> Self::Output { match self { Sign::Negative => Sign::Positive, Sign::Zero => Sign::Zero, Sign::Positive => Sign::Negative, } } } // A negative positive is a negative. assert_eq!(-Sign::Positive, Sign::Negative); // A double negative is a positive. assert_eq!(-Sign::Negative, Sign::Positive); // Zero is its own negation. assert_eq!(-Sign::Zero, Sign::Zero); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#688)#### type Output The resulting type after applying the `-` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#700)#### fn neg(self) -> Self::Output Performs the unary `-` operation. ##### Example ``` let x: i32 = 12; assert_eq!(-x, -12); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &f32 #### type Output = <f32 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &f64 #### type Output = <f64 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &i8 #### type Output = <i8 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &i16 #### type Output = <i16 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &i32 #### type Output = <i32 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &i64 #### type Output = <i64 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &i128 #### type Output = <i128 as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for &isize #### type Output = <isize as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i8> #### type Output = <Saturating<i8> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i16> #### type Output = <Saturating<i16> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i32> #### type Output = <Saturating<i32> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i64> #### type Output = <Saturating<i64> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<i128> #### type Output = <Saturating<i128> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for &Saturating<isize> #### type Output = <Saturating<isize> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i8> #### type Output = <Wrapping<i8> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i16> #### type Output = <Wrapping<i16> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i32> #### type Output = <Wrapping<i32> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i64> #### type Output = <Wrapping<i64> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<i128> #### type Output = <Wrapping<i128> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<isize> #### type Output = <Wrapping<isize> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u8> #### type Output = <Wrapping<u8> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u16> #### type Output = <Wrapping<u16> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u32> #### type Output = <Wrapping<u32> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u64> #### type Output = <Wrapping<u64> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<u128> #### type Output = <Wrapping<u128> as Neg>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for &Wrapping<usize> #### type Output = <Wrapping<usize> as Neg>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for f32 #### type Output = f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for f64 #### type Output = f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Neg for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#992)### impl Neg for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.10.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<f32, LANES>where [f32](../primitive.f32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<f64, LANES>where [f64](../primitive.f64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i8, LANES>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i16, LANES>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i32, LANES>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<i64, LANES>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/unary.rs.html#24-38)### impl<const LANES: usize> Neg for Simd<isize, LANES>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, LANES> rust Trait std::ops::DerefMut Trait std::ops::DerefMut ======================== ``` pub trait DerefMut: Deref { fn deref_mut(&mut self) -> &mut Self::Target; } ``` Used for mutable dereferencing operations, like in `*v = 1;`. In addition to being used for explicit dereferencing operations with the (unary) `*` operator in mutable contexts, `DerefMut` is also used implicitly by the compiler in many circumstances. This mechanism is called [‘`Deref` coercion’](#more-on-deref-coercion). In immutable contexts, [`Deref`](trait.deref "Deref") is used. Implementing `DerefMut` for smart pointers makes mutating the data behind them convenient, which is why they implement `DerefMut`. On the other hand, the rules regarding [`Deref`](trait.deref "Deref") and `DerefMut` were designed specifically to accommodate smart pointers. Because of this, **`DerefMut` should only be implemented for smart pointers** to avoid confusion. For similar reasons, **this trait should never fail**. Failure during dereferencing can be extremely confusing when `DerefMut` is invoked implicitly. More on `Deref` coercion ------------------------ If `T` implements `DerefMut<Target = U>`, and `x` is a value of type `T`, then: * In mutable contexts, `*x` (where `T` is neither a reference nor a raw pointer) is equivalent to `*DerefMut::deref_mut(&mut x)`. * Values of type `&mut T` are coerced to values of type `&mut U` * `T` implicitly implements all the (mutable) methods of the type `U`. For more details, visit [the chapter in *The Rust Programming Language*](../../book/ch15-02-deref) as well as the reference sections on [the dereference operator](../../reference/expressions/operator-expr#the-dereference-operator), [method resolution](../../reference/expressions/method-call-expr) and [type coercions](../../reference/type-coercions). Examples -------- A struct with a single field which is modifiable by dereferencing the struct. ``` use std::ops::{Deref, DerefMut}; struct DerefMutExample<T> { value: T } impl<T> Deref for DerefMutExample<T> { type Target = T; fn deref(&self) -> &Self::Target { &self.value } } impl<T> DerefMut for DerefMutExample<T> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value } } let mut x = DerefMutExample { value: 'a' }; *x = 'b'; assert_eq!('b', x.value); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#175)#### fn deref\_mut(&mut self) -> &mut Self::Target Mutably dereferences the value. Implementors ------------ [source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#520-525)1.44.0 · ### impl DerefMut for OsString [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2439)1.3.0 · ### impl DerefMut for String [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1190-1195)1.36.0 · ### impl<'a> DerefMut for IoSliceMut<'a> [source](https://doc.rust-lang.org/src/core/ffi/mod.rs.html#443)### impl<'a, 'f> DerefMut for VaList<'a, 'f>where 'f: 'a, [source](https://doc.rust-lang.org/src/core/pin.rs.html#879)1.33.0 · ### impl<P> DerefMut for Pin<P>where P: [DerefMut](trait.derefmut "trait std::ops::DerefMut"), <P as [Deref](trait.deref "trait std::ops::Deref")>::[Target](trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#90)### impl<T> !DerefMut for &Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/deref.rs.html#179)### impl<T> DerefMut for &mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed/thin.rs.html#122)### impl<T> DerefMut for ThinBox<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/cell.rs.html#1728)### impl<T> DerefMut for RefMut<'\_, T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#313)1.12.0 · ### impl<T> DerefMut for PeekMut<'\_, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), [source](https://doc.rust-lang.org/src/core/mem/manually_drop.rs.html#160)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88955 "Tracking issue for const_deref")) · ### impl<T> DerefMut for ManuallyDrop<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/panic/unwind_safe.rs.html#260)1.9.0 · ### impl<T> DerefMut for AssertUnwindSafe<T> [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1861)const: [unstable](https://github.com/rust-lang/rust/issues/92521 "Tracking issue for const_box") · ### impl<T, A> DerefMut for Box<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2538)### impl<T, A> DerefMut for Vec<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), [source](https://doc.rust-lang.org/src/std/sync/mutex.rs.html#517-521)### impl<T: ?Sized> DerefMut for MutexGuard<'\_, T> [source](https://doc.rust-lang.org/src/std/sync/rwlock.rs.html#591-596)### impl<T: ?Sized> DerefMut for RwLockWriteGuard<'\_, T>
programming_docs
rust Struct std::ops::RangeInclusive Struct std::ops::RangeInclusive =============================== ``` pub struct RangeInclusive<Idx> { /* private fields */ } ``` A range bounded inclusively below and above (`start..=end`). The `RangeInclusive` `start..=end` contains all values with `x >= start` and `x <= end`. It is empty unless `start <= end`. This iterator is [fused](../iter/trait.fusediterator), but the specific values of `start` and `end` after iteration has finished are **unspecified** other than that [`.is_empty()`](struct.rangeinclusive#method.is_empty) will return `true` once no more values will be produced. Examples -------- The `start..=end` syntax is a `RangeInclusive`: ``` assert_eq!((3..=5), std::ops::RangeInclusive::new(3, 5)); assert_eq!(3 + 4 + 5, (3..=5).sum()); ``` ``` let arr = [0, 1, 2, 3, 4]; assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]); assert_eq!(arr[ .. 3], [0, 1, 2 ]); assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); assert_eq!(arr[1.. ], [ 1, 2, 3, 4]); assert_eq!(arr[1.. 3], [ 1, 2 ]); assert_eq!(arr[1..=3], [ 1, 2, 3 ]); // This is a `RangeInclusive` ``` Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#359)### impl<Idx> RangeInclusive<Idx> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#374)1.27.0 (const: 1.32.0) · #### pub const fn new(start: Idx, end: Idx) -> RangeInclusive<Idx> Notable traits for [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> ``` impl<A> Iterator for RangeInclusive<A>where     A: Step, type Item = A; ``` Creates a new inclusive range. Equivalent to writing `start..=end`. ##### Examples ``` use std::ops::RangeInclusive; assert_eq!(3..=5, RangeInclusive::new(3, 5)); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#399)1.27.0 (const: 1.32.0) · #### pub const fn start(&self) -> &Idx Returns the lower bound of the range (inclusive). When using an inclusive range for iteration, the values of `start()` and [`end()`](struct.rangeinclusive#method.end) are unspecified after the iteration ended. To determine whether the inclusive range is empty, use the [`is_empty()`](struct.rangeinclusive#method.is_empty) method instead of comparing `start() > end()`. Note: the value returned by this method is unspecified after the range has been iterated to exhaustion. ##### Examples ``` assert_eq!((3..=5).start(), &3); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#424)1.27.0 (const: 1.32.0) · #### pub const fn end(&self) -> &Idx Returns the upper bound of the range (inclusive). When using an inclusive range for iteration, the values of [`start()`](struct.rangeinclusive#method.start) and `end()` are unspecified after the iteration ended. To determine whether the inclusive range is empty, use the [`is_empty()`](struct.rangeinclusive#method.is_empty) method instead of comparing `start() > end()`. Note: the value returned by this method is unspecified after the range has been iterated to exhaustion. ##### Examples ``` assert_eq!((3..=5).end(), &5); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#440)1.27.0 · #### pub fn into\_inner(self) -> (Idx, Idx) Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound). Note: the value returned by this method is unspecified after the range has been iterated to exhaustion. ##### Examples ``` assert_eq!((3..=5).into_inner(), (3, 5)); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#472)### impl<Idx> RangeInclusive<Idx>where Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#503-506)1.35.0 · #### pub fn contains<U>(&self, item: &U) -> boolwhere Idx: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Idx> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. ##### Examples ``` assert!(!(3..=5).contains(&2)); assert!( (3..=5).contains(&3)); assert!( (3..=5).contains(&4)); assert!( (3..=5).contains(&5)); assert!(!(3..=5).contains(&6)); assert!( (3..=3).contains(&3)); assert!(!(3..=2).contains(&3)); assert!( (0.0..=1.0).contains(&1.0)); assert!(!(0.0..=1.0).contains(&f32::NAN)); assert!(!(0.0..=f32::NAN).contains(&0.0)); assert!(!(f32::NAN..=1.0).contains(&1.0)); ``` This method always returns `false` after iteration has finished: ``` let mut r = 3..=5; assert!(r.contains(&3) && r.contains(&5)); for _ in r.by_ref() {} // Precise field values are unspecified here assert!(!r.contains(&3) && !r.contains(&5)); ``` [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#539)1.47.0 · #### pub fn is\_empty(&self) -> bool Returns `true` if the range contains no items. ##### Examples ``` assert!(!(3..=5).is_empty()); assert!(!(3..=3).is_empty()); assert!( (3..=2).is_empty()); ``` The range is empty if either side is incomparable: ``` assert!(!(3.0..=5.0).is_empty()); assert!( (3.0..=f32::NAN).is_empty()); assert!( (f32::NAN..=5.0).is_empty()); ``` This method returns `true` after iteration has finished: ``` let mut r = 3..=5; for _ in r.by_ref() {} // Precise field values are unspecified here assert!(r.is_empty()); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)### impl<Idx> Clone for RangeInclusive<Idx>where Idx: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)#### fn clone(&self) -> RangeInclusive<Idx> Notable traits for [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> ``` impl<A> Iterator for RangeInclusive<A>where     A: Step, type Item = A; ``` Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#460)### impl<Idx> Debug for RangeInclusive<Idx>where Idx: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#461)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1189)### impl<A> DoubleEndedIterator for RangeInclusive<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1191)#### fn next\_back(&mut self) -> Option<A> Removes and returns an element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#tymethod.next_back) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1196)#### fn nth\_back(&mut self, n: usize) -> Option<A> Returns the `n`th element from the end of the iterator. [Read more](../iter/trait.doubleendediterator#method.nth_back) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1224-1228)#### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, <[RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = B>, [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A>: [Sized](../marker/trait.sized "trait std::marker::Sized"), This is the reverse version of [`Iterator::try_fold()`](../iter/trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](../iter/trait.doubleendediterator#method.try_rfold) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1234-1237)#### fn rfold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, <[RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A>: [Sized](../marker/trait.sized "trait std::marker::Sized"), An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](../iter/trait.doubleendediterator#method.rfold) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#134)#### fn advance\_back\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator from the back by `n` elements. [Read more](../iter/trait.doubleendediterator#method.advance_back_by) [source](https://doc.rust-lang.org/src/core/iter/traits/double_ended.rs.html#347-350)1.27.0 · #### fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator from the back that satisfies a predicate. [Read more](../iter/trait.doubleendediterator#method.rfind) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#803-813)### impl ExactSizeIterator for RangeInclusive<i16> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)1.0.0 · #### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#803-813)### impl ExactSizeIterator for RangeInclusive<i8> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)1.0.0 · #### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#803-813)### impl ExactSizeIterator for RangeInclusive<u16> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)1.0.0 · #### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#803-813)### impl ExactSizeIterator for RangeInclusive<u8> [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#106)1.0.0 · #### fn len(&self) -> usize Returns the exact remaining length of the iterator. [Read more](../iter/trait.exactsizeiterator#method.len) [source](https://doc.rust-lang.org/src/core/iter/traits/exact_size.rs.html#138)#### fn is\_empty(&self) -> bool 🔬This is a nightly-only experimental API. (`exact_size_is_empty` [#35428](https://github.com/rust-lang/rust/issues/35428)) Returns `true` if the iterator is empty. [Read more](../iter/trait.exactsizeiterator#method.is_empty) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)### impl<Idx> Hash for RangeInclusive<Idx>where Idx: [Hash](../hash/trait.hash "trait std::hash::Hash"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)#### fn hash<\_\_H>(&self, state: &mut \_\_H)where \_\_H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds this value into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#tymethod.hash) [source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#237-239)1.3.0 · #### fn hash\_slice<H>(data: &[Self], state: &mut H)where H: [Hasher](../hash/trait.hasher "trait std::hash::Hasher"), Feeds a slice of this type into the given [`Hasher`](../hash/trait.hasher "Hasher"). [Read more](../hash/trait.hash#method.hash_slice) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2367)### impl Index<RangeInclusive<usize>> for String #### type Output = str The returned type after indexing. [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2371)#### fn index(&self, index: RangeInclusive<usize>) -> &str Performs the indexing (`container[index]`) operation. [Read more](trait.index#tymethod.index) [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2414)### impl IndexMut<RangeInclusive<usize>> for String [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2416)#### fn index\_mut(&mut self, index: RangeInclusive<usize>) -> &mut str Performs the mutable indexing (`container[index]`) operation. [Read more](trait.indexmut#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1095)### impl<A> Iterator for RangeInclusive<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), #### type Item = A The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1099)#### fn next(&mut self) -> Option<A> Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1104)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1116)#### fn nth(&mut self, n: usize) -> Option<A> Returns the `n`th element of the iterator. [Read more](../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1144-1148)#### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, <[RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = B>, [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A>: [Sized](../marker/trait.sized "trait std::marker::Sized"), An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1154-1157)#### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(B, <[RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> as [Iterator](../iter/trait.iterator "trait std::iter::Iterator")>::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A>: [Sized](../marker/trait.sized "trait std::marker::Sized"), Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1168)#### fn last(self) -> Option<A> Consumes the iterator, returning the last element. [Read more](../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1173)#### fn min(self) -> Option<A> Returns the minimum element of an iterator. [Read more](../iter/trait.iterator#method.min) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1178)#### fn max(self) -> Option<A> Returns the maximum element of an iterator. [Read more](../iter/trait.iterator#method.max) [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1183)#### fn is\_sorted(self) -> bool 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted. [Read more](../iter/trait.iterator#method.is_sorted) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [Filter](../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../iter/struct.peekable#method.peek) and [`peek_mut`](../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [SkipWhile](../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Notable traits for [TakeWhile](../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../option/enum.option#variant.None "None"). [Read more](../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2079-2082)#### fn partition\_in\_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a mut](../primitive.reference) T>, P: [FnMut](trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_partition_in_place` [#62543](https://github.com/rust-lang/rust/issues/62543)) Reorders the elements of this iterator *in-place* according to the given predicate, such that all those that return `true` precede all those that return `false`. Returns the number of `true` elements found. [Read more](../iter/trait.iterator#method.partition_in_place) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = [()](../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](trait.try "trait std::ops::Try")<Output = [bool](../primitive.bool)>, <R as [Try](trait.try "trait std::ops::Try")>::[Residual](trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](trait.residual "trait std::ops::Residual")<[Option](../option/enum.option "enum std::option::Option")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)1.0.0 · #### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](../iter/trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), Notable traits for [Rev](../iter/struct.rev "struct std::iter::Rev")<I> ``` impl<I> Iterator for Rev<I>where     I: DoubleEndedIterator, type Item = <I as Iterator>::Item; ``` Reverses an iterator’s direction. [Read more](../iter/trait.iterator#method.rev) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Copied](../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>, Notable traits for [Cloned](../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3312-3314)1.0.0 · #### fn cycle(self) -> Cycle<Self>where Self: [Clone](../clone/trait.clone "trait std::clone::Clone"), Notable traits for [Cycle](../iter/struct.cycle "struct std::iter::Cycle")<I> ``` impl<I> Iterator for Cycle<I>where     I: Clone + Iterator, type Item = <I as Iterator>::Item; ``` Repeats an iterator endlessly. [Read more](../iter/trait.iterator#method.cycle) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../iter/trait.product "trait std::iter::Product")<Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another. [Read more](../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../iter/trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<[Ordering](../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")(Self::[Item](../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../iter/trait.iterator#method.is_sorted_by_key) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)### impl<Idx> PartialEq<RangeInclusive<Idx>> for RangeInclusive<Idx>where Idx: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<Idx>, [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)#### fn eq(&self, other: &RangeInclusive<Idx>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#956)1.28.0 · ### impl<T> RangeBounds<T> for RangeInclusive<&T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#957)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#960)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#870)1.28.0 · ### impl<T> RangeBounds<T> for RangeInclusive<T> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#871)#### fn start\_bound(&self) -> Bound<&T> Start index bound. [Read more](trait.rangebounds#tymethod.start_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#874)#### fn end\_bound(&self) -> Bound<&T> End index bound. [Read more](trait.rangebounds#tymethod.end_bound) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#810-813)1.35.0 · #### fn contains<U>(&self, item: &U) -> boolwhere T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<U>, U: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), Returns `true` if `item` is contained in the range. [Read more](trait.rangebounds#method.contains) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#456)const: unstable · ### impl<T> SliceIndex<[T]> for RangeInclusive<usize> #### type Output = [T] The output type returned by methods. [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#460)const: unstable · #### fn get(self, slice: &[T]) -> Option<&[T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#465)const: unstable · #### fn get\_mut(self, slice: &mut [T]) -> Option<&mut [T]> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#470)const: unstable · #### unsafe fn get\_unchecked(self, slice: \*const [T]) -> \*const [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#476)const: unstable · #### unsafe fn get\_unchecked\_mut(self, slice: \*mut [T]) -> \*mut [T] 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#482)const: unstable · #### fn index(self, slice: &[T]) -> &[T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/slice/index.rs.html#490)const: unstable · #### fn index\_mut(self, slice: &mut [T]) -> &mut [T] Notable traits for &[[u8](../primitive.u8)] ``` impl Read for &[u8] impl Write for &mut [u8] ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#403)const: unstable · ### impl SliceIndex<str> for RangeInclusive<usize> Implements substring slicing with syntax `&self[begin ..= end]` or `&mut self[begin ..= end]`. Returns a slice of the given string from the byte range [`begin`, `end`]. Equivalent to `&self [begin .. end + 1]` or `&mut self[begin .. end + 1]`, except if `end` has the maximum value for `usize`. This operation is *O*(1). #### Panics Panics if `begin` does not point to the starting byte offset of a character (as defined by `is_char_boundary`), if `end` does not point to the ending byte offset of a character (`end + 1` is either a starting byte offset or equal to `len`), if `begin > end`, or if `end >= len`. #### type Output = str The output type returned by methods. [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#406)const: unstable · #### fn get( self, slice: &str) -> Option<&<RangeInclusive<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#410)const: unstable · #### fn get\_mut( self, slice: &mut str) -> Option<&mut <RangeInclusive<usize> as SliceIndex<str>>::Output> 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, if in bounds. [Read more](../slice/trait.sliceindex#tymethod.get_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#414)const: unstable · #### unsafe fn get\_unchecked( self, slice: \*const str) -> \*const <RangeInclusive<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#419)const: unstable · #### unsafe fn get\_unchecked\_mut( self, slice: \*mut str) -> \*mut <RangeInclusive<usize> as SliceIndex<str>>::Output 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index or a dangling `slice` pointer is *[undefined behavior](../../reference/behavior-considered-undefined)* even if the resulting reference is not used. [Read more](../slice/trait.sliceindex#tymethod.get_unchecked_mut) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#424)const: unstable · #### fn index( self, slice: &str) -> &<RangeInclusive<usize> as SliceIndex<str>>::Output Notable traits for [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> ``` impl<A> Iterator for RangeInclusive<A>where     A: Step, type Item = A; ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a shared reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index) [source](https://doc.rust-lang.org/src/core/str/traits.rs.html#431)const: unstable · #### fn index\_mut( self, slice: &mut str) -> &mut <RangeInclusive<usize> as SliceIndex<str>>::Output Notable traits for [RangeInclusive](struct.rangeinclusive "struct std::ops::RangeInclusive")<A> ``` impl<A> Iterator for RangeInclusive<A>where     A: Step, type Item = A; ``` 🔬This is a nightly-only experimental API. (`slice_index_methods`) Returns a mutable reference to the output at this location, panicking if out of bounds. [Read more](../slice/trait.sliceindex#tymethod.index_mut) [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)### impl<Idx> Eq for RangeInclusive<Idx>where Idx: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1253)### impl<A> FusedIterator for RangeInclusive<A>where A: [Step](../iter/trait.step "trait std::iter::Step"), [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)### impl<Idx> StructuralEq for RangeInclusive<Idx> [source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)### impl<Idx> StructuralPartialEq for RangeInclusive<Idx> [source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1250)### impl<A> TrustedLen for RangeInclusive<A>where A: [TrustedStep](../iter/trait.trustedstep "trait std::iter::TrustedStep"), Auto Trait Implementations -------------------------- ### impl<Idx> RefUnwindSafe for RangeInclusive<Idx>where Idx: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<Idx> Send for RangeInclusive<Idx>where Idx: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<Idx> Sync for RangeInclusive<Idx>where Idx: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<Idx> Unpin for RangeInclusive<Idx>where Idx: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<Idx> UnwindSafe for RangeInclusive<Idx>where Idx: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Trait std::ops::ShrAssign Trait std::ops::ShrAssign ========================= ``` pub trait ShrAssign<Rhs = Self> { fn shr_assign(&mut self, rhs: Rhs); } ``` The right shift assignment operator `>>=`. Examples -------- An implementation of `ShrAssign` for a wrapper around `usize`. ``` use std::ops::ShrAssign; #[derive(Debug, PartialEq)] struct Scalar(usize); impl ShrAssign<usize> for Scalar { fn shr_assign(&mut self, rhs: usize) { self.0 >>= rhs; } } let mut scalar = Scalar(16); scalar >>= 2; assert_eq!(scalar, Scalar(4)); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1007)#### fn shr\_assign(&mut self, rhs: Rhs) Performs the `>>=` operation. ##### Examples ``` let mut x: u8 = 5; x >>= 1; assert_eq!(x, 2); let mut x: u8 = 2; x >>= 1; assert_eq!(x, 1); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&i128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&isize> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&u128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShrAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShrAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<i128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<isize> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<u128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShrAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShrAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> ShrAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shr](trait.shr "trait std::ops::Shr")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shr](trait.shr "trait std::ops::Shr")<U>>::[Output](trait.shr#associatedtype.Output "type std::ops::Shr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Trait std::ops::ShlAssign Trait std::ops::ShlAssign ========================= ``` pub trait ShlAssign<Rhs = Self> { fn shl_assign(&mut self, rhs: Rhs); } ``` The left shift assignment operator `<<=`. Examples -------- An implementation of `ShlAssign` for a wrapper around `usize`. ``` use std::ops::ShlAssign; #[derive(Debug, PartialEq)] struct Scalar(usize); impl ShlAssign<usize> for Scalar { fn shl_assign(&mut self, rhs: usize) { self.0 <<= rhs; } } let mut scalar = Scalar(4); scalar <<= 2; assert_eq!(scalar, Scalar(16)); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#924)#### fn shl\_assign(&mut self, rhs: Rhs) Performs the `<<=` operation. ##### Examples ``` let mut x: u8 = 5; x <<= 1; assert_eq!(x, 10); let mut x: u8 = 1; x <<= 1; assert_eq!(x, 2); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&i128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&isize> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&u128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)1.22.0 · ### impl ShlAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl ShlAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<i128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<isize> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u8> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u16> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u32> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u64> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<u128> for usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl ShlAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl ShlAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> ShlAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](trait.shl "trait std::ops::Shl")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](trait.shl "trait std::ops::Shl")<U>>::[Output](trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Trait std::ops::Add Trait std::ops::Add =================== ``` pub trait Add<Rhs = Self> { type Output; fn add(self, rhs: Rhs) -> Self::Output; } ``` The addition operator `+`. Note that `Rhs` is `Self` by default, but this is not mandatory. For example, [`std::time::SystemTime`](../time/struct.systemtime) implements `Add<Duration>`, which permits operations of the form `SystemTime = SystemTime + Duration`. Examples -------- ### `Add`able points ``` use std::ops::Add; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl Add for Point { type Output = Self; fn add(self, other: Self) -> Self { Self { x: self.x + other.x, y: self.y + other.y, } } } assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, Point { x: 3, y: 3 }); ``` ### Implementing `Add` with generics Here is an example of the same `Point` struct implementing the `Add` trait using generics. ``` use std::ops::Add; #[derive(Debug, Copy, Clone, PartialEq)] struct Point<T> { x: T, y: T, } // Notice that the implementation uses the associated type `Output`. impl<T: Add<Output = T>> Add for Point<T> { type Output = Self; fn add(self, other: Self) -> Self::Output { Self { x: self.x + other.x, y: self.y + other.y, } } } assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, Point { x: 3, y: 3 }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#103)#### type Output The resulting type after applying the `+` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#114)#### fn add(self, rhs: Rhs) -> Self::Output Performs the `+` operation. ##### Example ``` assert_eq!(12 + 1, 13); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&f32> for &f32 #### type Output = <f32 as Add<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&f32> for f32 #### type Output = <f32 as Add<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&f64> for &f64 #### type Output = <f64 as Add<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&f64> for f64 #### type Output = <f64 as Add<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i8> for &i8 #### type Output = <i8 as Add<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i8> for i8 #### type Output = <i8 as Add<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i16> for &i16 #### type Output = <i16 as Add<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i16> for i16 #### type Output = <i16 as Add<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i32> for &i32 #### type Output = <i32 as Add<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i32> for i32 #### type Output = <i32 as Add<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i64> for &i64 #### type Output = <i64 as Add<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i64> for i64 #### type Output = <i64 as Add<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i128> for &i128 #### type Output = <i128 as Add<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&i128> for i128 #### type Output = <i128 as Add<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&isize> for &isize #### type Output = <isize as Add<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&isize> for isize #### type Output = <isize as Add<isize>>::Output [source](https://doc.rust-lang.org/src/alloc/string.rs.html#2308)### impl Add<&str> for String Implements the `+` operator for concatenating two strings. This consumes the `String` on the left-hand side and re-uses its buffer (growing it if necessary). This is done to avoid allocating a new `String` and copying the entire contents on every operation, which would lead to *O*(*n*^2) running time when building an *n*-byte string by repeated concatenation. The string on the right-hand side is only borrowed; its contents are copied into the returned `String`. #### Examples Concatenating two `String`s takes the first by value and borrows the second: ``` let a = String::from("hello"); let b = String::from(" world"); let c = a + &b; // `a` is moved and can no longer be used here. ``` If you want to keep using the first `String`, you can clone it and append to the clone instead: ``` let a = String::from("hello"); let b = String::from(" world"); let c = a.clone() + &b; // `a` is still valid here. ``` Concatenating `&str` slices can be done by converting the first to a `String`: ``` let a = "hello"; let b = " world"; let c = a.to_string() + b; ``` #### type Output = String [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u8> for &u8 #### type Output = <u8 as Add<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u8> for u8 #### type Output = <u8 as Add<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u16> for &u16 #### type Output = <u16 as Add<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u16> for u16 #### type Output = <u16 as Add<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u32> for &u32 #### type Output = <u32 as Add<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u32> for u32 #### type Output = <u32 as Add<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u64> for &u64 #### type Output = <u64 as Add<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u64> for u64 #### type Output = <u64 as Add<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u128> for &u128 #### type Output = <u128 as Add<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&u128> for u128 #### type Output = <u128 as Add<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&usize> for &usize #### type Output = <usize as Add<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<&usize> for usize #### type Output = <usize as Add<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Add<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Add<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Add<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Add<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Add<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Add<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Add<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Add<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Add<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Add<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Add<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Add<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Add<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Add<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Add<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Add<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Add<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Add<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Add<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Add<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Add<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Add<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Add<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Add<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<f32> for f32 #### type Output = f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<f64> for f64 #### type Output = f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/mem/transmutability.rs.html#89)const: [unstable](https://github.com/rust-lang/rust/issues/99571 "Tracking issue for transmutability") · ### impl Add<Assume> for Assume #### type Output = Assume [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Add<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Add<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/time.rs.html#910)1.3.0 · ### impl Add<Duration> for Duration #### type Output = Duration [source](https://doc.rust-lang.org/src/std/time.rs.html#400-410)1.8.0 · ### impl Add<Duration> for Instant #### type Output = Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#576-586)1.8.0 · ### impl Add<Duration> for SystemTime #### type Output = SystemTime [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#441)1.14.0 · ### impl<'a> Add<&'a str> for Cow<'a, str> #### type Output = Cow<'a, str> [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#453)1.14.0 · ### impl<'a> Add<Cow<'a, str>> for Cow<'a, str> #### type Output = Cow<'a, str> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<f32> for &'a f32 #### type Output = <f32 as Add<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<f64> for &'a f64 #### type Output = <f64 as Add<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<i8> for &'a i8 #### type Output = <i8 as Add<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<i16> for &'a i16 #### type Output = <i16 as Add<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<i32> for &'a i32 #### type Output = <i32 as Add<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<i64> for &'a i64 #### type Output = <i64 as Add<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<i128> for &'a i128 #### type Output = <i128 as Add<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<isize> for &'a isize #### type Output = <isize as Add<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<u8> for &'a u8 #### type Output = <u8 as Add<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<u16> for &'a u16 #### type Output = <u16 as Add<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<u32> for &'a u32 #### type Output = <u32 as Add<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<u64> for &'a u64 #### type Output = <u64 as Add<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<u128> for &'a u128 #### type Output = <u128 as Add<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Add<usize> for &'a usize #### type Output = <usize as Add<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Add<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Add<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Add<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Add<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Add<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Add<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Add<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Add<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Add<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Add<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Add<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Add<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Add<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Add<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Add<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Add](trait.add "trait std::ops::Add")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Add](trait.add "trait std::ops::Add")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Add<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Add](trait.add "trait std::ops::Add")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Add](trait.add "trait std::ops::Add")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Add<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Add](trait.add "trait std::ops::Add")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Add](trait.add "trait std::ops::Add")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.add#associatedtype.Output "type std::ops::Add::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Add<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Add<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Add<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::Div Trait std::ops::Div =================== ``` pub trait Div<Rhs = Self> { type Output; fn div(self, rhs: Rhs) -> Self::Output; } ``` The division operator `/`. Note that `Rhs` is `Self` by default, but this is not mandatory. Examples -------- ### `Div`idable rational numbers ``` use std::ops::Div; // By the fundamental theorem of arithmetic, rational numbers in lowest // terms are unique. So, by keeping `Rational`s in reduced form, we can // derive `Eq` and `PartialEq`. #[derive(Debug, Eq, PartialEq)] struct Rational { numerator: usize, denominator: usize, } impl Rational { fn new(numerator: usize, denominator: usize) -> Self { if denominator == 0 { panic!("Zero is an invalid denominator!"); } // Reduce to lowest terms by dividing by the greatest common // divisor. let gcd = gcd(numerator, denominator); Self { numerator: numerator / gcd, denominator: denominator / gcd, } } } impl Div for Rational { // The division of rational numbers is a closed operation. type Output = Self; fn div(self, rhs: Self) -> Self::Output { if rhs.numerator == 0 { panic!("Cannot divide by zero-valued `Rational`!"); } let numerator = self.numerator * rhs.denominator; let denominator = self.denominator * rhs.numerator; Self::new(numerator, denominator) } } // Euclid's two-thousand-year-old algorithm for finding the greatest common // divisor. fn gcd(x: usize, y: usize) -> usize { let mut x = x; let mut y = y; while y != 0 { let t = y; y = x % y; x = t; } x } assert_eq!(Rational::new(1, 2), Rational::new(2, 4)); assert_eq!(Rational::new(1, 2) / Rational::new(3, 4), Rational::new(2, 3)); ``` ### Dividing vectors by scalars as in linear algebra ``` use std::ops::Div; struct Scalar { value: f32 } #[derive(Debug, PartialEq)] struct Vector { value: Vec<f32> } impl Div<Scalar> for Vector { type Output = Self; fn div(self, rhs: Scalar) -> Self::Output { Self { value: self.value.iter().map(|v| v / rhs.value).collect() } } } let scalar = Scalar { value: 2f32 }; let vector = Vector { value: vec![2f32, 4f32, 6f32] }; assert_eq!(vector / scalar, Vector { value: vec![1f32, 2f32, 3f32] }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#472)#### type Output The resulting type after applying the `/` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#483)#### fn div(self, rhs: Rhs) -> Self::Output Performs the `/` operation. ##### Example ``` assert_eq!(12 / 2, 6); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&f32> for &f32 #### type Output = <f32 as Div<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&f32> for f32 #### type Output = <f32 as Div<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&f64> for &f64 #### type Output = <f64 as Div<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&f64> for f64 #### type Output = <f64 as Div<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i8> for &i8 #### type Output = <i8 as Div<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i8> for i8 #### type Output = <i8 as Div<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i16> for &i16 #### type Output = <i16 as Div<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i16> for i16 #### type Output = <i16 as Div<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i32> for &i32 #### type Output = <i32 as Div<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i32> for i32 #### type Output = <i32 as Div<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i64> for &i64 #### type Output = <i64 as Div<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i64> for i64 #### type Output = <i64 as Div<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i128> for &i128 #### type Output = <i128 as Div<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&i128> for i128 #### type Output = <i128 as Div<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&isize> for &isize #### type Output = <isize as Div<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&isize> for isize #### type Output = <isize as Div<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u8> for &u8 #### type Output = <u8 as Div<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u8> for u8 #### type Output = <u8 as Div<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u16> for &u16 #### type Output = <u16 as Div<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u16> for u16 #### type Output = <u16 as Div<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u32> for &u32 #### type Output = <u32 as Div<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u32> for u32 #### type Output = <u32 as Div<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u64> for &u64 #### type Output = <u64 as Div<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u64> for u64 #### type Output = <u64 as Div<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u128> for &u128 #### type Output = <u128 as Div<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&u128> for u128 #### type Output = <u128 as Div<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&usize> for &usize #### type Output = <usize as Div<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<&usize> for usize #### type Output = <usize as Div<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Div<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Div<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Div<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Div<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Div<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Div<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Div<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Div<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Div<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Div<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Div<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Div<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Div<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Div<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Div<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Div<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Div<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Div<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Div<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Div<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Div<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Div<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Div<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Div<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<f32> for f32 #### type Output = f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<f64> for f64 #### type Output = f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<i8> for i8 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0` or the division results in overflow. #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<i16> for i16 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0` or the division results in overflow. #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<i32> for i32 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0` or the division results in overflow. #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<i64> for i64 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0` or the division results in overflow. #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<i128> for i128 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0` or the division results in overflow. #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<isize> for isize This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0` or the division results in overflow. #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<u8> for u8 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0`. #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<u16> for u16 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0`. #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<u32> for u32 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0`. #### type Output = u32 [source](https://doc.rust-lang.org/src/core/time.rs.html#967)1.3.0 · ### impl Div<u32> for Duration #### type Output = Duration [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<u64> for u64 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0`. #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<u128> for u128 This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0`. #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Div<usize> for usize This operation rounds towards zero, truncating any fractional part of the exact result. #### Panics This operation will panic if `other == 0`. #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroU128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<NonZeroUsize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i8>> for Saturating<i8> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i8), Saturating(5i8) / Saturating(2)); assert_eq!(Saturating(i8::MAX), Saturating(i8::MAX) / Saturating(1)); assert_eq!(Saturating(i8::MIN), Saturating(i8::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i8) / Saturating(0); ``` #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i16>> for Saturating<i16> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i16), Saturating(5i16) / Saturating(2)); assert_eq!(Saturating(i16::MAX), Saturating(i16::MAX) / Saturating(1)); assert_eq!(Saturating(i16::MIN), Saturating(i16::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i16) / Saturating(0); ``` #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i32>> for Saturating<i32> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i32), Saturating(5i32) / Saturating(2)); assert_eq!(Saturating(i32::MAX), Saturating(i32::MAX) / Saturating(1)); assert_eq!(Saturating(i32::MIN), Saturating(i32::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i32) / Saturating(0); ``` #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i64>> for Saturating<i64> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i64), Saturating(5i64) / Saturating(2)); assert_eq!(Saturating(i64::MAX), Saturating(i64::MAX) / Saturating(1)); assert_eq!(Saturating(i64::MIN), Saturating(i64::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i64) / Saturating(0); ``` #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<i128>> for Saturating<i128> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2i128), Saturating(5i128) / Saturating(2)); assert_eq!(Saturating(i128::MAX), Saturating(i128::MAX) / Saturating(1)); assert_eq!(Saturating(i128::MIN), Saturating(i128::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0i128) / Saturating(0); ``` #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<isize>> for Saturating<isize> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2isize), Saturating(5isize) / Saturating(2)); assert_eq!(Saturating(isize::MAX), Saturating(isize::MAX) / Saturating(1)); assert_eq!(Saturating(isize::MIN), Saturating(isize::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0isize) / Saturating(0); ``` #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u8>> for Saturating<u8> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u8), Saturating(5u8) / Saturating(2)); assert_eq!(Saturating(u8::MAX), Saturating(u8::MAX) / Saturating(1)); assert_eq!(Saturating(u8::MIN), Saturating(u8::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u8) / Saturating(0); ``` #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u16>> for Saturating<u16> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u16), Saturating(5u16) / Saturating(2)); assert_eq!(Saturating(u16::MAX), Saturating(u16::MAX) / Saturating(1)); assert_eq!(Saturating(u16::MIN), Saturating(u16::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u16) / Saturating(0); ``` #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u32>> for Saturating<u32> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u32), Saturating(5u32) / Saturating(2)); assert_eq!(Saturating(u32::MAX), Saturating(u32::MAX) / Saturating(1)); assert_eq!(Saturating(u32::MIN), Saturating(u32::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u32) / Saturating(0); ``` #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u64>> for Saturating<u64> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u64), Saturating(5u64) / Saturating(2)); assert_eq!(Saturating(u64::MAX), Saturating(u64::MAX) / Saturating(1)); assert_eq!(Saturating(u64::MIN), Saturating(u64::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u64) / Saturating(0); ``` #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<u128>> for Saturating<u128> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2u128), Saturating(5u128) / Saturating(2)); assert_eq!(Saturating(u128::MAX), Saturating(u128::MAX) / Saturating(1)); assert_eq!(Saturating(u128::MIN), Saturating(u128::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0u128) / Saturating(0); ``` #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Div<Saturating<usize>> for Saturating<usize> #### Examples Basic usage: ``` #![feature(saturating_int_impl)] use std::num::Saturating; assert_eq!(Saturating(2usize), Saturating(5usize) / Saturating(2)); assert_eq!(Saturating(usize::MAX), Saturating(usize::MAX) / Saturating(1)); assert_eq!(Saturating(usize::MIN), Saturating(usize::MIN) / Saturating(1)); ``` ⓘ ``` #![feature(saturating_int_impl)] use std::num::Saturating; let _ = Saturating(0usize) / Saturating(0); ``` #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.3.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Div<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<f32> for &'a f32 #### type Output = <f32 as Div<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#527)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<f64> for &'a f64 #### type Output = <f64 as Div<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<i8> for &'a i8 #### type Output = <i8 as Div<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<i16> for &'a i16 #### type Output = <i16 as Div<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<i32> for &'a i32 #### type Output = <i32 as Div<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<i64> for &'a i64 #### type Output = <i64 as Div<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<i128> for &'a i128 #### type Output = <i128 as Div<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<isize> for &'a isize #### type Output = <isize as Div<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<u8> for &'a u8 #### type Output = <u8 as Div<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<u16> for &'a u16 #### type Output = <u16 as Div<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<u32> for &'a u32 #### type Output = <u32 as Div<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<u64> for &'a u64 #### type Output = <u64 as Div<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<u128> for &'a u128 #### type Output = <u128 as Div<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Div<usize> for &'a usize #### type Output = <usize as Div<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Div<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Div<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Div<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Div<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Div<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Div<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Div<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Div<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Div<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Div<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Div<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Div<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Div<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Div<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Div<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Div<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Div<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Div<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Div<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Div<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Div<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Div<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Div<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Div<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Div<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Div<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Div<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Div](trait.div "trait std::ops::Div")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Div](trait.div "trait std::ops::Div")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Div<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Div](trait.div "trait std::ops::Div")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Div](trait.div "trait std::ops::Div")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Div<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Div](trait.div "trait std::ops::Div")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Div](trait.div "trait std::ops::Div")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.div#associatedtype.Output "type std::ops::Div::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Div<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Div<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Div<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::FnMut Trait std::ops::FnMut ===================== ``` pub trait FnMut<Args>: FnOnce<Args> { extern "rust-call" fn call_mut(        &mut self,        args: Args    ) -> Self::Output; } ``` The version of the call operator that takes a mutable receiver. Instances of `FnMut` can be called repeatedly and may mutate state. `FnMut` is implemented automatically by closures which take mutable references to captured variables, as well as all types that implement [`Fn`](trait.fn "Fn"), e.g., (safe) [function pointers](../primitive.fn) (since `FnMut` is a supertrait of [`Fn`](trait.fn "Fn")). Additionally, for any type `F` that implements `FnMut`, `&mut F` implements `FnMut`, too. Since [`FnOnce`](trait.fnonce "FnOnce") is a supertrait of `FnMut`, any instance of `FnMut` can be used where a [`FnOnce`](trait.fnonce "FnOnce") is expected, and since [`Fn`](trait.fn "Fn") is a subtrait of `FnMut`, any instance of [`Fn`](trait.fn "Fn") can be used where `FnMut` is expected. Use `FnMut` as a bound when you want to accept a parameter of function-like type and need to call it repeatedly, while allowing it to mutate state. If you don’t want the parameter to mutate state, use [`Fn`](trait.fn "Fn") as a bound; if you don’t need to call it repeatedly, use [`FnOnce`](trait.fnonce "FnOnce"). See the [chapter on closures in *The Rust Programming Language*](../../book/ch13-01-closures) for some more information on this topic. Also of note is the special syntax for `Fn` traits (e.g. `Fn(usize, bool) -> usize`). Those interested in the technical details of this can refer to [the relevant section in the *Rustonomicon*](https://doc.rust-lang.org/nomicon/hrtb.html). Examples -------- ### Calling a mutably capturing closure ``` let mut x = 5; { let mut square_x = || x *= x; square_x(); } assert_eq!(x, 25); ``` ### Using a `FnMut` parameter ``` fn do_twice<F>(mut func: F) where F: FnMut() { func(); func(); } let mut x: usize = 1; { let add_two_to_x = || x += 2; do_twice(add_two_to_x); } assert_eq!(x, 5); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#164)#### extern "rust-call" fn call\_mut(&mut self, args: Args) -> Self::Output 🔬This is a nightly-only experimental API. (`fn_traits` [#29625](https://github.com/rust-lang/rust/issues/29625)) Performs the call operation. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#265)const: [unstable](https://github.com/rust-lang/rust/issues/101803 "Tracking issue for const_fn_trait_ref_impls") · ### impl<A, F> FnMut<A> for &Fwhere F: [Fn](trait.fn "trait std::ops::Fn")<A> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/ops/function.rs.html#289)const: [unstable](https://github.com/rust-lang/rust/issues/101803 "Tracking issue for const_fn_trait_ref_impls") · ### impl<A, F> FnMut<A> for &mut Fwhere F: [FnMut](trait.fnmut "trait std::ops::FnMut")<A> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1945)1.35.0 · ### impl<Args, F, A> FnMut<Args> for Box<F, A>where F: [FnMut](trait.fnmut "trait std::ops::FnMut")<Args> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), rust Trait std::ops::SubAssign Trait std::ops::SubAssign ========================= ``` pub trait SubAssign<Rhs = Self> { fn sub_assign(&mut self, rhs: Rhs); } ``` The subtraction assignment operator `-=`. Examples -------- This example creates a `Point` struct that implements the `SubAssign` trait, and then demonstrates sub-assigning to a mutable `Point`. ``` use std::ops::SubAssign; #[derive(Debug, Copy, Clone, PartialEq)] struct Point { x: i32, y: i32, } impl SubAssign for Point { fn sub_assign(&mut self, other: Self) { *self = Self { x: self.x - other.x, y: self.y - other.y, }; } } let mut point = Point { x: 3, y: 3 }; point -= Point { x: 2, y: 3 }; assert_eq!(point, Point {x: 1, y: 0}); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#836)#### fn sub\_assign(&mut self, rhs: Rhs) Performs the `-=` operation. ##### Example ``` let mut x: u32 = 12; x -= 1; assert_eq!(x, 11); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl SubAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<f32> for f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<f64> for f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl SubAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl SubAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl SubAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/time.rs.html#935)1.9.0 · ### impl SubAssign<Duration> for Duration [source](https://doc.rust-lang.org/src/std/time.rs.html#429-433)1.9.0 · ### impl SubAssign<Duration> for Instant [source](https://doc.rust-lang.org/src/std/time.rs.html#605-609)1.9.0 · ### impl SubAssign<Duration> for SystemTime [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> SubAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Sub](trait.sub "trait std::ops::Sub")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Sub](trait.sub "trait std::ops::Sub")<U>>::[Output](trait.sub#associatedtype.Output "type std::ops::Sub::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>,
programming_docs
rust Trait std::ops::Generator Trait std::ops::Generator ========================= ``` pub trait Generator<R = ()> { type Yield; type Return; fn resume(        self: Pin<&mut Self>,        arg: R    ) -> GeneratorState<Self::Yield, Self::Return>; } ``` 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The trait implemented by builtin generator types. Generators, also commonly referred to as coroutines, are currently an experimental language feature in Rust. Added in [RFC 2033](https://github.com/rust-lang/rfcs/pull/2033) generators are currently intended to primarily provide a building block for async/await syntax but will likely extend to also providing an ergonomic definition for iterators and other primitives. The syntax and semantics for generators is unstable and will require a further RFC for stabilization. At this time, though, the syntax is closure-like: ``` #![feature(generators, generator_trait)] use std::ops::{Generator, GeneratorState}; use std::pin::Pin; fn main() { let mut generator = || { yield 1; "foo" }; match Pin::new(&mut generator).resume(()) { GeneratorState::Yielded(1) => {} _ => panic!("unexpected return from resume"), } match Pin::new(&mut generator).resume(()) { GeneratorState::Complete("foo") => {} _ => panic!("unexpected return from resume"), } } ``` More documentation of generators can be found in the [unstable book](https://doc.rust-lang.org/unstable-book/language-features/generators.html). Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#78)#### type Yield 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The type of value this generator yields. This associated type corresponds to the `yield` expression and the values which are allowed to be returned each time a generator yields. For example an iterator-as-a-generator would likely have this type as `T`, the type being iterated over. [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#87)#### type Return 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) The type of value this generator returns. This corresponds to the type returned from a generator either with a `return` statement or implicitly as the last expression of a generator literal. For example futures would use this as `Result<T, E>` as it represents a completed future. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#115)#### fn resume( self: Pin<&mut Self>, arg: R) -> GeneratorState<Self::Yield, Self::Return> 🔬This is a nightly-only experimental API. (`generator_trait` [#43122](https://github.com/rust-lang/rust/issues/43122)) Resumes the execution of this generator. This function will resume execution of the generator or start execution if it hasn’t already. This call will return back into the generator’s last suspension point, resuming execution from the latest `yield`. The generator will continue executing until it either yields or returns, at which point this function will return. ##### Return value The `GeneratorState` enum returned from this function indicates what state the generator is in upon returning. If the `Yielded` variant is returned then the generator has reached a suspension point and a value has been yielded out. Generators in this state are available for resumption at a later point. If `Complete` is returned then the generator has completely finished with the value provided. It is invalid for the generator to be resumed again. ##### Panics This function may panic if it is called after the `Complete` variant has been returned previously. While generator literals in the language are guaranteed to panic on resuming after `Complete`, this is not guaranteed for all implementations of the `Generator` trait. Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#129)### impl<G, R> Generator<R> for &mut Gwhere G: [Generator](trait.generator "trait std::ops::Generator")<R> + [Unpin](../marker/trait.unpin "trait std::marker::Unpin") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Yield = <G as Generator<R>>::Yield #### type Return = <G as Generator<R>>::Return [source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#119)### impl<G, R> Generator<R> for Pin<&mut G>where G: [Generator](trait.generator "trait std::ops::Generator")<R> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), #### type Yield = <G as Generator<R>>::Yield #### type Return = <G as Generator<R>>::Return [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2044)### impl<G, R, A> Generator<R> for Box<G, A>where G: [Generator](trait.generator "trait std::ops::Generator")<R> + [Unpin](../marker/trait.unpin "trait std::marker::Unpin") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, #### type Yield = <G as Generator<R>>::Yield #### type Return = <G as Generator<R>>::Return [source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#2057)### impl<G, R, A> Generator<R> for Pin<Box<G, A>>where G: [Generator](trait.generator "trait std::ops::Generator")<R> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + 'static, #### type Yield = <G as Generator<R>>::Yield #### type Return = <G as Generator<R>>::Return rust Trait std::ops::Rem Trait std::ops::Rem =================== ``` pub trait Rem<Rhs = Self> { type Output; fn rem(self, rhs: Rhs) -> Self::Output; } ``` The remainder operator `%`. Note that `Rhs` is `Self` by default, but this is not mandatory. Examples -------- This example implements `Rem` on a `SplitSlice` object. After `Rem` is implemented, one can use the `%` operator to find out what the remaining elements of the slice would be after splitting it into equal slices of a given length. ``` use std::ops::Rem; #[derive(PartialEq, Debug)] struct SplitSlice<'a, T: 'a> { slice: &'a [T], } impl<'a, T> Rem<usize> for SplitSlice<'a, T> { type Output = Self; fn rem(self, modulus: usize) -> Self::Output { let len = self.slice.len(); let rem = len % modulus; let start = len - rem; Self {slice: &self.slice[start..]} } } // If we were to divide &[0, 1, 2, 3, 4, 5, 6, 7] into slices of size 3, // the remainder would be &[6, 7]. assert_eq!(SplitSlice { slice: &[0, 1, 2, 3, 4, 5, 6, 7] } % 3, SplitSlice { slice: &[6, 7] }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#574)#### type Output The resulting type after applying the `%` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#585)#### fn rem(self, rhs: Rhs) -> Self::Output Performs the `%` operation. ##### Example ``` assert_eq!(12 % 10, 2); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&f32> for &f32 #### type Output = <f32 as Rem<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&f32> for f32 #### type Output = <f32 as Rem<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&f64> for &f64 #### type Output = <f64 as Rem<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&f64> for f64 #### type Output = <f64 as Rem<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i8> for &i8 #### type Output = <i8 as Rem<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i8> for i8 #### type Output = <i8 as Rem<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i16> for &i16 #### type Output = <i16 as Rem<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i16> for i16 #### type Output = <i16 as Rem<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i32> for &i32 #### type Output = <i32 as Rem<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i32> for i32 #### type Output = <i32 as Rem<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i64> for &i64 #### type Output = <i64 as Rem<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i64> for i64 #### type Output = <i64 as Rem<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i128> for &i128 #### type Output = <i128 as Rem<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&i128> for i128 #### type Output = <i128 as Rem<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&isize> for &isize #### type Output = <isize as Rem<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&isize> for isize #### type Output = <isize as Rem<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u8> for &u8 #### type Output = <u8 as Rem<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u8> for u8 #### type Output = <u8 as Rem<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u16> for &u16 #### type Output = <u16 as Rem<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u16> for u16 #### type Output = <u16 as Rem<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u32> for &u32 #### type Output = <u32 as Rem<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u32> for u32 #### type Output = <u32 as Rem<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u64> for &u64 #### type Output = <u64 as Rem<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u64> for u64 #### type Output = <u64 as Rem<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u128> for &u128 #### type Output = <u128 as Rem<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&u128> for u128 #### type Output = <u128 as Rem<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&usize> for &usize #### type Output = <usize as Rem<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<&usize> for usize #### type Output = <usize as Rem<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Rem<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as Rem<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Rem<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as Rem<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Rem<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as Rem<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Rem<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as Rem<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Rem<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as Rem<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Rem<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as Rem<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Rem<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as Rem<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Rem<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as Rem<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Rem<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as Rem<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Rem<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as Rem<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Rem<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as Rem<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Rem<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as Rem<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<f32> for f32 The remainder from the division of two floats. The remainder has the same sign as the dividend and is computed as: `x - (x / y).trunc() * y`. #### Examples ``` let x: f32 = 50.50; let y: f32 = 8.125; let remainder = x - (x / y).trunc() * y; // The answer to both operations is 1.75 assert_eq!(x % y, remainder); ``` #### type Output = f32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<f64> for f64 The remainder from the division of two floats. The remainder has the same sign as the dividend and is computed as: `x - (x / y).trunc() * y`. #### Examples ``` let x: f32 = 50.50; let y: f32 = 8.125; let remainder = x - (x / y).trunc() * y; // The answer to both operations is 1.75 assert_eq!(x % y, remainder); ``` #### type Output = f64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<i8> for i8 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0` or if `self / other` results in overflow. #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<i16> for i16 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0` or if `self / other` results in overflow. #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<i32> for i32 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0` or if `self / other` results in overflow. #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<i64> for i64 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0` or if `self / other` results in overflow. #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<i128> for i128 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0` or if `self / other` results in overflow. #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<isize> for isize This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0` or if `self / other` results in overflow. #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<u8> for u8 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0`. #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<u16> for u16 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0`. #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<u32> for u32 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0`. #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<u64> for u64 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0`. #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<u128> for u128 This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0`. #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Rem<usize> for usize This operation satisfies `n % d == n - (n / d) * d`. The result has the same sign as the left operand. #### Panics This operation will panic if `other == 0`. #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroU128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#298-305)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<NonZeroUsize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl Rem<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Rem<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<f32> for &'a f32 #### type Output = <f32 as Rem<f32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<f64> for &'a f64 #### type Output = <f64 as Rem<f64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<i8> for &'a i8 #### type Output = <i8 as Rem<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<i16> for &'a i16 #### type Output = <i16 as Rem<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<i32> for &'a i32 #### type Output = <i32 as Rem<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<i64> for &'a i64 #### type Output = <i64 as Rem<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<i128> for &'a i128 #### type Output = <i128 as Rem<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<isize> for &'a isize #### type Output = <isize as Rem<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<u8> for &'a u8 #### type Output = <u8 as Rem<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<u16> for &'a u16 #### type Output = <u16 as Rem<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<u32> for &'a u32 #### type Output = <u32 as Rem<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<u64> for &'a u64 #### type Output = <u64 as Rem<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<u128> for &'a u128 #### type Output = <u128 as Rem<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Rem<usize> for &'a usize #### type Output = <usize as Rem<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Rem<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Rem<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Rem<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Rem<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Rem<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Rem<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Rem<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Rem<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Rem<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Rem<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Rem<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> Rem<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Rem<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Rem<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Rem<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Rem<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Rem<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Rem<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Rem<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Rem<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Rem<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Rem<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Rem<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Rem<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Rem<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Rem<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Rem<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](trait.rem "trait std::ops::Rem")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](trait.rem "trait std::ops::Rem")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Rem<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](trait.rem "trait std::ops::Rem")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](trait.rem "trait std::ops::Rem")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Rem<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Rem](trait.rem "trait std::ops::Rem")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Rem](trait.rem "trait std::ops::Rem")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.rem#associatedtype.Output "type std::ops::Rem::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Rem<Simd<f32, N>> for Simd<f32, N>where [f32](../primitive.f32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#229-254)### impl<const N: usize> Rem<Simd<f64, N>> for Simd<f64, N>where [f64](../primitive.f64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<f64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Rem<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::BitOrAssign Trait std::ops::BitOrAssign =========================== ``` pub trait BitOrAssign<Rhs = Self> { fn bitor_assign(&mut self, rhs: Rhs); } ``` The bitwise OR assignment operator `|=`. Examples -------- ``` use std::ops::BitOrAssign; #[derive(Debug, PartialEq)] struct PersonalPreferences { likes_cats: bool, likes_dogs: bool, } impl BitOrAssign for PersonalPreferences { fn bitor_assign(&mut self, rhs: Self) { self.likes_cats |= rhs.likes_cats; self.likes_dogs |= rhs.likes_dogs; } } let mut prefs = PersonalPreferences { likes_cats: true, likes_dogs: false }; prefs |= PersonalPreferences { likes_cats: false, likes_dogs: true }; assert_eq!(prefs, PersonalPreferences { likes_cats: true, likes_dogs: true }); ``` Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#790)#### fn bitor\_assign(&mut self, rhs: Rhs) Performs the `|=` operation. ##### Examples ``` let mut x = true; x |= false; assert_eq!(x, true); let mut x = false; x |= false; assert_eq!(x, false); let mut x: u8 = 5; x |= 1; assert_eq!(x, 5); let mut x: u8 = 5; x |= 2; assert_eq!(x, 7); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&bool> for bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i8> for i8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i16> for i16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i32> for i32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i64> for i64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i128> for i128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&isize> for isize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u8> for u8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u16> for u16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u32> for u32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u64> for u64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u128> for u128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&usize> for usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)1.22.0 · ### impl BitOrAssign<&Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.22.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<&Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<bool> for bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<i8> for i8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i8> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i8> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<i16> for i16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i16> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i16> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<i32> for i32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i32> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i32> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<i64> for i64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i64> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i64> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<i128> for i128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<i128> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<i128> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<isize> for isize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<isize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<isize> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<isize> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<u8> for u8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u8> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u8> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<u16> for u16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u16> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u16> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<u32> for u32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u32> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u32> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<u64> for u64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u64> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u64> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<u128> for u128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<u128> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<u128> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#806)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<usize> for usize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<usize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<usize> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.60.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<usize> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI8> for NonZeroI8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI16> for NonZeroI16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI32> for NonZeroI32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI64> for NonZeroI64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroI128> for NonZeroI128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroIsize> for NonZeroIsize [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU8> for NonZeroU8 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU16> for NonZeroU16 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU32> for NonZeroU32 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU64> for NonZeroU64 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroU128> for NonZeroU128 [source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.45.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOrAssign<NonZeroUsize> for NonZeroUsize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i8>> for Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i16>> for Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i32>> for Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i64>> for Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<i128>> for Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<isize>> for Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u8>> for Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u16>> for Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u32>> for Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u64>> for Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<u128>> for Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitOrAssign<Saturating<usize>> for Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<i8>> for Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<i16>> for Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<i32>> for Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<i64>> for Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<i128>> for Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<isize>> for Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<u8>> for Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<u16>> for Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<u32>> for Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<u64>> for Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<u128>> for Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitOrAssign<Wrapping<usize>> for Wrapping<usize> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/assign.rs.html#33-124)### impl<T, U, const LANES: usize> BitOrAssign<U> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitOr](trait.bitor "trait std::ops::BitOr")<U>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitOr](trait.bitor "trait std::ops::BitOr")<U>>::[Output](trait.bitor#associatedtype.Output "type std::ops::BitOr::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#490)### impl<T, const LANES: usize> BitOrAssign<bool> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#479)### impl<T, const LANES: usize> BitOrAssign<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"),
programming_docs
rust Enum std::ops::ControlFlow Enum std::ops::ControlFlow ========================== ``` pub enum ControlFlow<B, C = ()> { Continue(C), Break(B), } ``` Used to tell an operation whether it should exit early or go on as usual. This is used when exposing things (like graph traversals or visitors) where you want the user to be able to choose whether to exit early. Having the enum makes it clearer – no more wondering “wait, what did `false` mean again?” – and allows including a value. Similar to [`Option`](../option/enum.option "Option") and [`Result`](../result/enum.result "Result"), this enum can be used with the `?` operator to return immediately if the [`Break`](enum.controlflow#variant.Break) variant is present or otherwise continue normally with the value inside the [`Continue`](enum.controlflow#variant.Continue) variant. Examples -------- Early-exiting from [`Iterator::try_for_each`](../iter/trait.iterator#method.try_for_each "Iterator::try_for_each"): ``` use std::ops::ControlFlow; let r = (2..100).try_for_each(|x| { if 403 % x == 0 { return ControlFlow::Break(x) } ControlFlow::Continue(()) }); assert_eq!(r, ControlFlow::Break(13)); ``` A basic tree traversal: ``` use std::ops::ControlFlow; pub struct TreeNode<T> { value: T, left: Option<Box<TreeNode<T>>>, right: Option<Box<TreeNode<T>>>, } impl<T> TreeNode<T> { pub fn traverse_inorder<B>(&self, f: &mut impl FnMut(&T) -> ControlFlow<B>) -> ControlFlow<B> { if let Some(left) = &self.left { left.traverse_inorder(f)?; } f(&self.value)?; if let Some(right) = &self.right { right.traverse_inorder(f)?; } ControlFlow::Continue(()) } fn leaf(value: T) -> Option<Box<TreeNode<T>>> { Some(Box::new(Self { value, left: None, right: None })) } } let node = TreeNode { value: 0, left: TreeNode::leaf(1), right: Some(Box::new(TreeNode { value: -1, left: TreeNode::leaf(5), right: TreeNode::leaf(2), })) }; let mut sum = 0; let res = node.traverse_inorder(&mut |val| { if *val < 0 { ControlFlow::Break(*val) } else { sum += *val; ControlFlow::Continue(()) } }); assert_eq!(res, ControlFlow::Break(-1)); assert_eq!(sum, 6); ``` Variants -------- ### `Continue(C)` Move on to the next phase of the operation as normal. ### `Break(B)` Exit the operation without running subsequent phases. Implementations --------------- [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#131)### impl<B, C> ControlFlow<B, C> [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#144)1.59.0 · #### pub fn is\_break(&self) -> bool Returns `true` if this is a `Break` variant. ##### Examples ``` use std::ops::ControlFlow; assert!(ControlFlow::<i32, String>::Break(3).is_break()); assert!(!ControlFlow::<String, i32>::Continue(3).is_break()); ``` [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#160)1.59.0 · #### pub fn is\_continue(&self) -> bool Returns `true` if this is a `Continue` variant. ##### Examples ``` use std::ops::ControlFlow; assert!(!ControlFlow::<i32, String>::Break(3).is_continue()); assert!(ControlFlow::<String, i32>::Continue(3).is_continue()); ``` [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#178)#### pub fn break\_value(self) -> Option<B> 🔬This is a nightly-only experimental API. (`control_flow_enum` [#75744](https://github.com/rust-lang/rust/issues/75744)) Converts the `ControlFlow` into an `Option` which is `Some` if the `ControlFlow` was `Break` and `None` otherwise. ##### Examples ``` #![feature(control_flow_enum)] use std::ops::ControlFlow; assert_eq!(ControlFlow::<i32, String>::Break(3).break_value(), Some(3)); assert_eq!(ControlFlow::<String, i32>::Continue(3).break_value(), None); ``` [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#189-191)#### pub fn map\_break<T, F>(self, f: F) -> ControlFlow<T, C>where F: [FnOnce](trait.fnonce "trait std::ops::FnOnce")(B) -> T, 🔬This is a nightly-only experimental API. (`control_flow_enum` [#75744](https://github.com/rust-lang/rust/issues/75744)) Maps `ControlFlow<B, C>` to `ControlFlow<T, C>` by applying a function to the break value in case it exists. [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#213)#### pub fn continue\_value(self) -> Option<C> 🔬This is a nightly-only experimental API. (`control_flow_enum` [#75744](https://github.com/rust-lang/rust/issues/75744)) Converts the `ControlFlow` into an `Option` which is `Some` if the `ControlFlow` was `Continue` and `None` otherwise. ##### Examples ``` #![feature(control_flow_enum)] use std::ops::ControlFlow; assert_eq!(ControlFlow::<i32, String>::Break(3).continue_value(), None); assert_eq!(ControlFlow::<String, i32>::Continue(3).continue_value(), Some(3)); ``` [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#224-226)#### pub fn map\_continue<T, F>(self, f: F) -> ControlFlow<B, T>where F: [FnOnce](trait.fnonce "trait std::ops::FnOnce")(C) -> T, 🔬This is a nightly-only experimental API. (`control_flow_enum` [#75744](https://github.com/rust-lang/rust/issues/75744)) Maps `ControlFlow<B, C>` to `ControlFlow<B, T>` by applying a function to the continue value in case it exists. [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#238)### impl<R> ControlFlow<R, <R as Try>::Output>where R: [Try](trait.try "trait std::ops::Try"), This impl block contains no items. These are used only as part of implementing the iterator adapters. They have mediocre names and non-obvious semantics, so aren’t currently on a path to potential stabilization. [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#258)### impl<B> ControlFlow<B, ()> [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#277)#### pub const CONTINUE: ControlFlow<B, ()> = ControlFlow::Continue(()) 🔬This is a nightly-only experimental API. (`control_flow_enum` [#75744](https://github.com/rust-lang/rust/issues/75744)) It’s frequently the case that there’s no value needed with `Continue`, so this provides a way to avoid typing `(())`, if you prefer it. ##### Examples ``` #![feature(control_flow_enum)] use std::ops::ControlFlow; let mut partial_sum = 0; let last_used = (1..10).chain(20..25).try_for_each(|x| { partial_sum += x; if partial_sum > 100 { ControlFlow::Break(x) } else { ControlFlow::CONTINUE } }); assert_eq!(last_used.break_value(), Some(22)); ``` [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#280)### impl<C> ControlFlow<(), C> [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#298)#### pub const BREAK: ControlFlow<(), C> = ControlFlow::Break(()) 🔬This is a nightly-only experimental API. (`control_flow_enum` [#75744](https://github.com/rust-lang/rust/issues/75744)) APIs like `try_for_each` don’t need values with `Break`, so this provides a way to avoid typing `(())`, if you prefer it. ##### Examples ``` #![feature(control_flow_enum)] use std::ops::ControlFlow; let mut partial_sum = 0; (1..10).chain(20..25).try_for_each(|x| { if partial_sum > 100 { ControlFlow::BREAK } else { partial_sum += x; ControlFlow::CONTINUE } }); assert_eq!(partial_sum, 108); ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)### impl<B, C> Clone for ControlFlow<B, C>where B: [Clone](../clone/trait.clone "trait std::clone::Clone"), C: [Clone](../clone/trait.clone "trait std::clone::Clone"), [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)#### fn clone(&self) -> ControlFlow<B, C> Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)### impl<B, C> Debug for ControlFlow<B, C>where B: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), C: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error> Formats the value using the given formatter. [Read more](../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#117)### impl<B, C> FromResidual<<ControlFlow<B, C> as Try>::Residual> for ControlFlow<B, C> [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#119)#### fn from\_residual(residual: ControlFlow<B, Infallible>) -> ControlFlow<B, C> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from a compatible `Residual` type. [Read more](trait.fromresidual#tymethod.from_residual) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)### impl<B, C> PartialEq<ControlFlow<B, C>> for ControlFlow<B, C>where B: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<B>, C: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<C>, [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)#### fn eq(&self, other: &ControlFlow<B, C>) -> bool This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](../cmp/trait.partialeq#tymethod.eq) [source](https://doc.rust-lang.org/src/core/cmp.rs.html#236)1.0.0 · #### fn ne(&self, other: &Rhs) -> bool This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. [Read more](../cmp/trait.partialeq#method.ne) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#127)### impl<B, C> Residual<C> for ControlFlow<B, Infallible> #### type TryType = ControlFlow<B, C> 🔬This is a nightly-only experimental API. (`try_trait_v2_residual` [#91285](https://github.com/rust-lang/rust/issues/91285)) The “return” type of this meta-function. [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#98)### impl<B, C> Try for ControlFlow<B, C> #### type Output = C 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value produced by `?` when *not* short-circuiting. #### type Residual = ControlFlow<B, Infallible> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) The type of the value passed to [`FromResidual::from_residual`](trait.fromresidual#tymethod.from_residual "FromResidual::from_residual") as part of `?` when short-circuiting. [Read more](trait.try#associatedtype.Residual) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#103)#### fn from\_output(output: <ControlFlow<B, C> as Try>::Output) -> ControlFlow<B, C> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Constructs the type from its `Output` type. [Read more](trait.try#tymethod.from_output) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#108)#### fn branch( self) -> ControlFlow<<ControlFlow<B, C> as Try>::Residual, <ControlFlow<B, C> as Try>::Output> 🔬This is a nightly-only experimental API. (`try_trait_v2` [#84277](https://github.com/rust-lang/rust/issues/84277)) Used in `?` to decide whether the operator should produce a value (because this returned [`ControlFlow::Continue`](enum.controlflow#variant.Continue "ControlFlow::Continue")) or propagate a value back to the caller (because this returned [`ControlFlow::Break`](enum.controlflow#variant.Break "ControlFlow::Break")). [Read more](trait.try#tymethod.branch) [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)### impl<B, C> Copy for ControlFlow<B, C>where B: [Copy](../marker/trait.copy "trait std::marker::Copy"), C: [Copy](../marker/trait.copy "trait std::marker::Copy"), [source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)### impl<B, C> StructuralPartialEq for ControlFlow<B, C> Auto Trait Implementations -------------------------- ### impl<B, C> RefUnwindSafe for ControlFlow<B, C>where B: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), C: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), ### impl<B, C> Send for ControlFlow<B, C>where B: [Send](../marker/trait.send "trait std::marker::Send"), C: [Send](../marker/trait.send "trait std::marker::Send"), ### impl<B, C> Sync for ControlFlow<B, C>where B: [Sync](../marker/trait.sync "trait std::marker::Sync"), C: [Sync](../marker/trait.sync "trait std::marker::Sync"), ### impl<B, C> Unpin for ControlFlow<B, C>where B: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), C: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), ### impl<B, C> UnwindSafe for ControlFlow<B, C>where B: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), C: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Trait std::ops::Shl Trait std::ops::Shl =================== ``` pub trait Shl<Rhs = Self> { type Output; fn shl(self, rhs: Rhs) -> Self::Output; } ``` The left shift operator `<<`. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust’s type checker has special handling for `_ << _`, setting the result type for integer operations to the type of the left-hand-side operand. This means that though `a << b` and `a.shl(b)` are one and the same from an evaluation standpoint, they are different when it comes to type inference. Examples -------- An implementation of `Shl` that lifts the `<<` operation on integers to a wrapper around `usize`. ``` use std::ops::Shl; #[derive(PartialEq, Debug)] struct Scalar(usize); impl Shl<Scalar> for Scalar { type Output = Self; fn shl(self, Self(rhs): Self) -> Self::Output { let Self(lhs) = self; Self(lhs << rhs) } } assert_eq!(Scalar(4) << Scalar(2), Scalar(16)); ``` An implementation of `Shl` that spins a vector leftward by a given amount. ``` use std::ops::Shl; #[derive(PartialEq, Debug)] struct SpinVector<T: Clone> { vec: Vec<T>, } impl<T: Clone> Shl<usize> for SpinVector<T> { type Output = Self; fn shl(self, rhs: usize) -> Self::Output { // Rotate the vector by `rhs` places. let (a, b) = self.vec.split_at(rhs); let mut spun_vector = vec![]; spun_vector.extend_from_slice(b); spun_vector.extend_from_slice(a); Self { vec: spun_vector } } } assert_eq!(SpinVector { vec: vec![0, 1, 2, 3, 4] } << 2, SpinVector { vec: vec![2, 3, 4, 0, 1] }); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#451)#### type Output The resulting type after applying the `<<` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#463)#### fn shl(self, rhs: Rhs) -> Self::Output Performs the `<<` operation. ##### Examples ``` assert_eq!(5u8 << 1, 10); assert_eq!(1u8 << 1, 2); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &i8 #### type Output = <i8 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &i16 #### type Output = <i16 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &i32 #### type Output = <i32 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &i64 #### type Output = <i64 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &i128 #### type Output = <i128 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &isize #### type Output = <isize as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &u8 #### type Output = <u8 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &u16 #### type Output = <u16 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &u32 #### type Output = <u32 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &u64 #### type Output = <u64 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &u128 #### type Output = <u128 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for &usize #### type Output = <usize as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for i8 #### type Output = <i8 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for i16 #### type Output = <i16 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for i32 #### type Output = <i32 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for i64 #### type Output = <i64 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for i128 #### type Output = <i128 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for isize #### type Output = <isize as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for u8 #### type Output = <u8 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for u16 #### type Output = <u16 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for u32 #### type Output = <u32 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for u64 #### type Output = <u64 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for u128 #### type Output = <u128 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i8> for usize #### type Output = <usize as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &i8 #### type Output = <i8 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &i16 #### type Output = <i16 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &i32 #### type Output = <i32 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &i64 #### type Output = <i64 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &i128 #### type Output = <i128 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &isize #### type Output = <isize as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &u8 #### type Output = <u8 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &u16 #### type Output = <u16 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &u32 #### type Output = <u32 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &u64 #### type Output = <u64 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &u128 #### type Output = <u128 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for &usize #### type Output = <usize as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for i8 #### type Output = <i8 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for i16 #### type Output = <i16 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for i32 #### type Output = <i32 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for i64 #### type Output = <i64 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for i128 #### type Output = <i128 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for isize #### type Output = <isize as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for u8 #### type Output = <u8 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for u16 #### type Output = <u16 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for u32 #### type Output = <u32 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for u64 #### type Output = <u64 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for u128 #### type Output = <u128 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i16> for usize #### type Output = <usize as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &i8 #### type Output = <i8 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &i16 #### type Output = <i16 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &i32 #### type Output = <i32 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &i64 #### type Output = <i64 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &i128 #### type Output = <i128 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &isize #### type Output = <isize as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &u8 #### type Output = <u8 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &u16 #### type Output = <u16 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &u32 #### type Output = <u32 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &u64 #### type Output = <u64 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &u128 #### type Output = <u128 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for &usize #### type Output = <usize as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for i8 #### type Output = <i8 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for i16 #### type Output = <i16 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for i32 #### type Output = <i32 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for i64 #### type Output = <i64 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for i128 #### type Output = <i128 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for isize #### type Output = <isize as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for u8 #### type Output = <u8 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for u16 #### type Output = <u16 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for u32 #### type Output = <u32 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for u64 #### type Output = <u64 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for u128 #### type Output = <u128 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i32> for usize #### type Output = <usize as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &i8 #### type Output = <i8 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &i16 #### type Output = <i16 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &i32 #### type Output = <i32 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &i64 #### type Output = <i64 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &i128 #### type Output = <i128 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &isize #### type Output = <isize as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &u8 #### type Output = <u8 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &u16 #### type Output = <u16 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &u32 #### type Output = <u32 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &u64 #### type Output = <u64 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &u128 #### type Output = <u128 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for &usize #### type Output = <usize as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for i8 #### type Output = <i8 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for i16 #### type Output = <i16 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for i32 #### type Output = <i32 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for i64 #### type Output = <i64 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for i128 #### type Output = <i128 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for isize #### type Output = <isize as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for u8 #### type Output = <u8 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for u16 #### type Output = <u16 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for u32 #### type Output = <u32 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for u64 #### type Output = <u64 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for u128 #### type Output = <u128 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i64> for usize #### type Output = <usize as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &i8 #### type Output = <i8 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &i16 #### type Output = <i16 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &i32 #### type Output = <i32 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &i64 #### type Output = <i64 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &i128 #### type Output = <i128 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &isize #### type Output = <isize as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &u8 #### type Output = <u8 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &u16 #### type Output = <u16 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &u32 #### type Output = <u32 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &u64 #### type Output = <u64 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &u128 #### type Output = <u128 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for &usize #### type Output = <usize as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for i8 #### type Output = <i8 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for i16 #### type Output = <i16 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for i32 #### type Output = <i32 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for i64 #### type Output = <i64 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for i128 #### type Output = <i128 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for isize #### type Output = <isize as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for u8 #### type Output = <u8 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for u16 #### type Output = <u16 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for u32 #### type Output = <u32 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for u64 #### type Output = <u64 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for u128 #### type Output = <u128 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&i128> for usize #### type Output = <usize as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &i8 #### type Output = <i8 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &i16 #### type Output = <i16 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &i32 #### type Output = <i32 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &i64 #### type Output = <i64 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &i128 #### type Output = <i128 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &isize #### type Output = <isize as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &u8 #### type Output = <u8 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &u16 #### type Output = <u16 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &u32 #### type Output = <u32 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &u64 #### type Output = <u64 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &u128 #### type Output = <u128 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for &usize #### type Output = <usize as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for i8 #### type Output = <i8 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for i16 #### type Output = <i16 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for i32 #### type Output = <i32 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for i64 #### type Output = <i64 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for i128 #### type Output = <i128 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for isize #### type Output = <isize as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for u8 #### type Output = <u8 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for u16 #### type Output = <u16 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for u32 #### type Output = <u32 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for u64 #### type Output = <u64 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for u128 #### type Output = <u128 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&isize> for usize #### type Output = <usize as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &i8 #### type Output = <i8 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &i16 #### type Output = <i16 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &i32 #### type Output = <i32 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &i64 #### type Output = <i64 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &i128 #### type Output = <i128 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &isize #### type Output = <isize as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &u8 #### type Output = <u8 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &u16 #### type Output = <u16 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &u32 #### type Output = <u32 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &u64 #### type Output = <u64 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &u128 #### type Output = <u128 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for &usize #### type Output = <usize as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for i8 #### type Output = <i8 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for i16 #### type Output = <i16 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for i32 #### type Output = <i32 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for i64 #### type Output = <i64 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for i128 #### type Output = <i128 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for isize #### type Output = <isize as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for u8 #### type Output = <u8 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for u16 #### type Output = <u16 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for u32 #### type Output = <u32 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for u64 #### type Output = <u64 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for u128 #### type Output = <u128 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u8> for usize #### type Output = <usize as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &i8 #### type Output = <i8 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &i16 #### type Output = <i16 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &i32 #### type Output = <i32 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &i64 #### type Output = <i64 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &i128 #### type Output = <i128 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &isize #### type Output = <isize as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &u8 #### type Output = <u8 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &u16 #### type Output = <u16 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &u32 #### type Output = <u32 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &u64 #### type Output = <u64 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &u128 #### type Output = <u128 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for &usize #### type Output = <usize as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for i8 #### type Output = <i8 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for i16 #### type Output = <i16 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for i32 #### type Output = <i32 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for i64 #### type Output = <i64 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for i128 #### type Output = <i128 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for isize #### type Output = <isize as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for u8 #### type Output = <u8 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for u16 #### type Output = <u16 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for u32 #### type Output = <u32 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for u64 #### type Output = <u64 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for u128 #### type Output = <u128 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u16> for usize #### type Output = <usize as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &i8 #### type Output = <i8 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &i16 #### type Output = <i16 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &i32 #### type Output = <i32 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &i64 #### type Output = <i64 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &i128 #### type Output = <i128 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &isize #### type Output = <isize as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &u8 #### type Output = <u8 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &u16 #### type Output = <u16 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &u32 #### type Output = <u32 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &u64 #### type Output = <u64 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &u128 #### type Output = <u128 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for &usize #### type Output = <usize as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for i8 #### type Output = <i8 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for i16 #### type Output = <i16 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for i32 #### type Output = <i32 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for i64 #### type Output = <i64 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for i128 #### type Output = <i128 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for isize #### type Output = <isize as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for u8 #### type Output = <u8 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for u16 #### type Output = <u16 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for u32 #### type Output = <u32 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for u64 #### type Output = <u64 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for u128 #### type Output = <u128 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u32> for usize #### type Output = <usize as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &i8 #### type Output = <i8 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &i16 #### type Output = <i16 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &i32 #### type Output = <i32 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &i64 #### type Output = <i64 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &i128 #### type Output = <i128 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &isize #### type Output = <isize as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &u8 #### type Output = <u8 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &u16 #### type Output = <u16 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &u32 #### type Output = <u32 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &u64 #### type Output = <u64 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &u128 #### type Output = <u128 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for &usize #### type Output = <usize as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for i8 #### type Output = <i8 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for i16 #### type Output = <i16 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for i32 #### type Output = <i32 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for i64 #### type Output = <i64 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for i128 #### type Output = <i128 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for isize #### type Output = <isize as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for u8 #### type Output = <u8 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for u16 #### type Output = <u16 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for u32 #### type Output = <u32 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for u64 #### type Output = <u64 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for u128 #### type Output = <u128 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u64> for usize #### type Output = <usize as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &i8 #### type Output = <i8 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &i16 #### type Output = <i16 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &i32 #### type Output = <i32 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &i64 #### type Output = <i64 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &i128 #### type Output = <i128 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &isize #### type Output = <isize as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &u8 #### type Output = <u8 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &u16 #### type Output = <u16 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &u32 #### type Output = <u32 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &u64 #### type Output = <u64 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &u128 #### type Output = <u128 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for &usize #### type Output = <usize as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for i8 #### type Output = <i8 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for i16 #### type Output = <i16 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for i32 #### type Output = <i32 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for i64 #### type Output = <i64 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for i128 #### type Output = <i128 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for isize #### type Output = <isize as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for u8 #### type Output = <u8 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for u16 #### type Output = <u16 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for u32 #### type Output = <u32 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for u64 #### type Output = <u64 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for u128 #### type Output = <u128 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&u128> for usize #### type Output = <usize as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &i8 #### type Output = <i8 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &i16 #### type Output = <i16 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &i32 #### type Output = <i32 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &i64 #### type Output = <i64 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &i128 #### type Output = <i128 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &isize #### type Output = <isize as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &u8 #### type Output = <u8 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &u16 #### type Output = <u16 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &u32 #### type Output = <u32 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &u64 #### type Output = <u64 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &u128 #### type Output = <u128 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for &usize #### type Output = <usize as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i8> #### type Output = <Saturating<i8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i16> #### type Output = <Saturating<i16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i32> #### type Output = <Saturating<i32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i64> #### type Output = <Saturating<i64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<i128> #### type Output = <Saturating<i128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<isize> #### type Output = <Saturating<isize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u8> #### type Output = <Saturating<u8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u16> #### type Output = <Saturating<u16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u32> #### type Output = <Saturating<u32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u64> #### type Output = <Saturating<u64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<u128> #### type Output = <Saturating<u128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for &Saturating<usize> #### type Output = <Saturating<usize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i8> #### type Output = <Wrapping<i8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i16> #### type Output = <Wrapping<i16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i32> #### type Output = <Wrapping<i32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i64> #### type Output = <Wrapping<i64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<i128> #### type Output = <Wrapping<i128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<isize> #### type Output = <Wrapping<isize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u8> #### type Output = <Wrapping<u8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u16> #### type Output = <Wrapping<u16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u32> #### type Output = <Wrapping<u32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u64> #### type Output = <Wrapping<u64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<u128> #### type Output = <Wrapping<u128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for &Wrapping<usize> #### type Output = <Wrapping<usize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for i8 #### type Output = <i8 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for i16 #### type Output = <i16 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for i32 #### type Output = <i32 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for i64 #### type Output = <i64 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for i128 #### type Output = <i128 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for isize #### type Output = <isize as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for u8 #### type Output = <u8 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for u16 #### type Output = <u16 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for u32 #### type Output = <u32 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for u64 #### type Output = <u64 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for u128 #### type Output = <u128 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<&usize> for usize #### type Output = <usize as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i8> #### type Output = <Saturating<i8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i16> #### type Output = <Saturating<i16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i32> #### type Output = <Saturating<i32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i64> #### type Output = <Saturating<i64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<i128> #### type Output = <Saturating<i128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<isize> #### type Output = <Saturating<isize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u8> #### type Output = <Saturating<u8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u16> #### type Output = <Saturating<u16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u32> #### type Output = <Saturating<u32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u64> #### type Output = <Saturating<u64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<u128> #### type Output = <Saturating<u128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<&usize> for Saturating<usize> #### type Output = <Saturating<usize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i8> #### type Output = <Wrapping<i8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i16> #### type Output = <Wrapping<i16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i32> #### type Output = <Wrapping<i32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i64> #### type Output = <Wrapping<i64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<i128> #### type Output = <Wrapping<i128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<isize> #### type Output = <Wrapping<isize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u8> #### type Output = <Wrapping<u8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u16> #### type Output = <Wrapping<u16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u32> #### type Output = <Wrapping<u32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u64> #### type Output = <Wrapping<u64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<u128> #### type Output = <Wrapping<u128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<&usize> for Wrapping<usize> #### type Output = <Wrapping<usize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i8> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i16> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i32> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i64> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<i128> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<isize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u8> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u16> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u32> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u64> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<u128> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl Shl<usize> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl Shl<usize> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a i8 #### type Output = <i8 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a i16 #### type Output = <i16 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a i32 #### type Output = <i32 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a i64 #### type Output = <i64 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a i128 #### type Output = <i128 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a isize #### type Output = <isize as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a u8 #### type Output = <u8 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a u16 #### type Output = <u16 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a u32 #### type Output = <u32 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a u64 #### type Output = <u64 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a u128 #### type Output = <u128 as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i8> for &'a usize #### type Output = <usize as Shl<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a i8 #### type Output = <i8 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a i16 #### type Output = <i16 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a i32 #### type Output = <i32 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a i64 #### type Output = <i64 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a i128 #### type Output = <i128 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a isize #### type Output = <isize as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a u8 #### type Output = <u8 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a u16 #### type Output = <u16 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a u32 #### type Output = <u32 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a u64 #### type Output = <u64 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a u128 #### type Output = <u128 as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i16> for &'a usize #### type Output = <usize as Shl<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a i8 #### type Output = <i8 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a i16 #### type Output = <i16 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a i32 #### type Output = <i32 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a i64 #### type Output = <i64 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a i128 #### type Output = <i128 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a isize #### type Output = <isize as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a u8 #### type Output = <u8 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a u16 #### type Output = <u16 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a u32 #### type Output = <u32 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a u64 #### type Output = <u64 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a u128 #### type Output = <u128 as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i32> for &'a usize #### type Output = <usize as Shl<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a i8 #### type Output = <i8 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a i16 #### type Output = <i16 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a i32 #### type Output = <i32 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a i64 #### type Output = <i64 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a i128 #### type Output = <i128 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a isize #### type Output = <isize as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a u8 #### type Output = <u8 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a u16 #### type Output = <u16 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a u32 #### type Output = <u32 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a u64 #### type Output = <u64 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a u128 #### type Output = <u128 as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i64> for &'a usize #### type Output = <usize as Shl<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a i8 #### type Output = <i8 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a i16 #### type Output = <i16 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a i32 #### type Output = <i32 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a i64 #### type Output = <i64 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a i128 #### type Output = <i128 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a isize #### type Output = <isize as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a u8 #### type Output = <u8 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a u16 #### type Output = <u16 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a u32 #### type Output = <u32 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a u64 #### type Output = <u64 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a u128 #### type Output = <u128 as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<i128> for &'a usize #### type Output = <usize as Shl<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a i8 #### type Output = <i8 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a i16 #### type Output = <i16 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a i32 #### type Output = <i32 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a i64 #### type Output = <i64 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a i128 #### type Output = <i128 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a isize #### type Output = <isize as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a u8 #### type Output = <u8 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a u16 #### type Output = <u16 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a u32 #### type Output = <u32 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a u64 #### type Output = <u64 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a u128 #### type Output = <u128 as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<isize> for &'a usize #### type Output = <usize as Shl<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a i8 #### type Output = <i8 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a i16 #### type Output = <i16 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a i32 #### type Output = <i32 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a i64 #### type Output = <i64 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a i128 #### type Output = <i128 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a isize #### type Output = <isize as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a u8 #### type Output = <u8 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a u16 #### type Output = <u16 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a u32 #### type Output = <u32 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a u64 #### type Output = <u64 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a u128 #### type Output = <u128 as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u8> for &'a usize #### type Output = <usize as Shl<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a i8 #### type Output = <i8 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a i16 #### type Output = <i16 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a i32 #### type Output = <i32 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a i64 #### type Output = <i64 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a i128 #### type Output = <i128 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a isize #### type Output = <isize as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a u8 #### type Output = <u8 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a u16 #### type Output = <u16 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a u32 #### type Output = <u32 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a u64 #### type Output = <u64 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a u128 #### type Output = <u128 as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u16> for &'a usize #### type Output = <usize as Shl<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a i8 #### type Output = <i8 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a i16 #### type Output = <i16 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a i32 #### type Output = <i32 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a i64 #### type Output = <i64 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a i128 #### type Output = <i128 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a isize #### type Output = <isize as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a u8 #### type Output = <u8 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a u16 #### type Output = <u16 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a u32 #### type Output = <u32 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a u64 #### type Output = <u64 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a u128 #### type Output = <u128 as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u32> for &'a usize #### type Output = <usize as Shl<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a i8 #### type Output = <i8 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a i16 #### type Output = <i16 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a i32 #### type Output = <i32 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a i64 #### type Output = <i64 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a i128 #### type Output = <i128 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a isize #### type Output = <isize as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a u8 #### type Output = <u8 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a u16 #### type Output = <u16 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a u32 #### type Output = <u32 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a u64 #### type Output = <u64 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a u128 #### type Output = <u128 as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u64> for &'a usize #### type Output = <usize as Shl<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a i8 #### type Output = <i8 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a i16 #### type Output = <i16 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a i32 #### type Output = <i32 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a i64 #### type Output = <i64 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a i128 #### type Output = <i128 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a isize #### type Output = <isize as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a u8 #### type Output = <u8 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a u16 #### type Output = <u16 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a u32 #### type Output = <u32 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a u64 #### type Output = <u64 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a u128 #### type Output = <u128 as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<u128> for &'a usize #### type Output = <usize as Shl<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a i8 #### type Output = <i8 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a i16 #### type Output = <i16 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a i32 #### type Output = <i32 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a i64 #### type Output = <i64 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a i128 #### type Output = <i128 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a isize #### type Output = <isize as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a u8 #### type Output = <u8 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a u16 #### type Output = <u16 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a u32 #### type Output = <u32 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a u64 #### type Output = <u64 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a u128 #### type Output = <u128 as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> Shl<usize> for &'a usize #### type Output = <usize as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i8> #### type Output = <Saturating<i8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i16> #### type Output = <Saturating<i16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i32> #### type Output = <Saturating<i32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i64> #### type Output = <Saturating<i64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<i128> #### type Output = <Saturating<i128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<isize> #### type Output = <Saturating<isize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u8> #### type Output = <Saturating<u8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u16> #### type Output = <Saturating<u16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u32> #### type Output = <Saturating<u32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u64> #### type Output = <Saturating<u64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<u128> #### type Output = <Saturating<u128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#203)### impl<'a> Shl<usize> for &'a Saturating<usize> #### type Output = <Saturating<usize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#214)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> Shl<usize> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as Shl<usize>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> Shl<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](trait.shl "trait std::ops::Shl")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](trait.shl "trait std::ops::Shl")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shl<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](trait.shl "trait std::ops::Shl")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](trait.shl "trait std::ops::Shl")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> Shl<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [Shl](trait.shl "trait std::ops::Shl")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [Shl](trait.shl "trait std::ops::Shl")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.shl#associatedtype.Output "type std::ops::Shl::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> Shl<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Trait std::ops::BitAnd Trait std::ops::BitAnd ====================== ``` pub trait BitAnd<Rhs = Self> { type Output; fn bitand(self, rhs: Rhs) -> Self::Output; } ``` The bitwise AND operator `&`. Note that `Rhs` is `Self` by default, but this is not mandatory. Examples -------- An implementation of `BitAnd` for a wrapper around `bool`. ``` use std::ops::BitAnd; #[derive(Debug, PartialEq)] struct Scalar(bool); impl BitAnd for Scalar { type Output = Self; // rhs is the "right-hand side" of the expression `a & b` fn bitand(self, rhs: Self) -> Self::Output { Self(self.0 & rhs.0) } } assert_eq!(Scalar(true) & Scalar(true), Scalar(true)); assert_eq!(Scalar(true) & Scalar(false), Scalar(false)); assert_eq!(Scalar(false) & Scalar(true), Scalar(false)); assert_eq!(Scalar(false) & Scalar(false), Scalar(false)); ``` An implementation of `BitAnd` for a wrapper around `Vec<bool>`. ``` use std::ops::BitAnd; #[derive(Debug, PartialEq)] struct BooleanVector(Vec<bool>); impl BitAnd for BooleanVector { type Output = Self; fn bitand(self, Self(rhs): Self) -> Self::Output { let Self(lhs) = self; assert_eq!(lhs.len(), rhs.len()); Self( lhs.iter() .zip(rhs.iter()) .map(|(x, y)| *x & *y) .collect() ) } } let bv1 = BooleanVector(vec![true, true, false, false]); let bv2 = BooleanVector(vec![true, false, true, false]); let expected = BooleanVector(vec![true, false, false, false]); assert_eq!(bv1 & bv2, expected); ``` Required Associated Types ------------------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#149)#### type Output The resulting type after applying the `&` operator. Required Methods ---------------- [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#163)#### fn bitand(self, rhs: Rhs) -> Self::Output Performs the `&` operation. ##### Examples ``` assert_eq!(true & false, false); assert_eq!(true & true, true); assert_eq!(5u8 & 1u8, 1); assert_eq!(5u8 & 2u8, 0); ``` Implementors ------------ [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&bool> for &bool #### type Output = <bool as BitAnd<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&bool> for bool #### type Output = <bool as BitAnd<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i8> for &i8 #### type Output = <i8 as BitAnd<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i8> for i8 #### type Output = <i8 as BitAnd<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i16> for &i16 #### type Output = <i16 as BitAnd<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i16> for i16 #### type Output = <i16 as BitAnd<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i32> for &i32 #### type Output = <i32 as BitAnd<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i32> for i32 #### type Output = <i32 as BitAnd<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i64> for &i64 #### type Output = <i64 as BitAnd<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i64> for i64 #### type Output = <i64 as BitAnd<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i128> for &i128 #### type Output = <i128 as BitAnd<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&i128> for i128 #### type Output = <i128 as BitAnd<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&isize> for &isize #### type Output = <isize as BitAnd<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&isize> for isize #### type Output = <isize as BitAnd<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u8> for &u8 #### type Output = <u8 as BitAnd<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u8> for u8 #### type Output = <u8 as BitAnd<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u16> for &u16 #### type Output = <u16 as BitAnd<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u16> for u16 #### type Output = <u16 as BitAnd<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u32> for &u32 #### type Output = <u32 as BitAnd<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u32> for u32 #### type Output = <u32 as BitAnd<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u64> for &u64 #### type Output = <u64 as BitAnd<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u64> for u64 #### type Output = <u64 as BitAnd<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u128> for &u128 #### type Output = <u128 as BitAnd<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&u128> for u128 #### type Output = <u128 as BitAnd<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&usize> for &usize #### type Output = <usize as BitAnd<usize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<&usize> for usize #### type Output = <usize as BitAnd<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i8>> for &Saturating<i8> #### type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i8>> for Saturating<i8> #### type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i16>> for &Saturating<i16> #### type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i16>> for Saturating<i16> #### type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i32>> for &Saturating<i32> #### type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i32>> for Saturating<i32> #### type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i64>> for &Saturating<i64> #### type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i64>> for Saturating<i64> #### type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i128>> for &Saturating<i128> #### type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<i128>> for Saturating<i128> #### type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<isize>> for &Saturating<isize> #### type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<isize>> for Saturating<isize> #### type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u8>> for &Saturating<u8> #### type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u8>> for Saturating<u8> #### type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u16>> for &Saturating<u16> #### type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u16>> for Saturating<u16> #### type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u32>> for &Saturating<u32> #### type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u32>> for Saturating<u32> #### type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u64>> for &Saturating<u64> #### type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u64>> for Saturating<u64> #### type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u128>> for &Saturating<u128> #### type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<u128>> for Saturating<u128> #### type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<usize>> for &Saturating<usize> #### type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<&Saturating<usize>> for Saturating<usize> #### type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i8>> for &Wrapping<i8> #### type Output = <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i8>> for Wrapping<i8> #### type Output = <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i16>> for &Wrapping<i16> #### type Output = <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i16>> for Wrapping<i16> #### type Output = <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i32>> for &Wrapping<i32> #### type Output = <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i32>> for Wrapping<i32> #### type Output = <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i64>> for &Wrapping<i64> #### type Output = <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i64>> for Wrapping<i64> #### type Output = <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i128>> for &Wrapping<i128> #### type Output = <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<i128>> for Wrapping<i128> #### type Output = <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<isize>> for &Wrapping<isize> #### type Output = <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<isize>> for Wrapping<isize> #### type Output = <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u8>> for &Wrapping<u8> #### type Output = <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u8>> for Wrapping<u8> #### type Output = <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u16>> for &Wrapping<u16> #### type Output = <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u16>> for Wrapping<u16> #### type Output = <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u32>> for &Wrapping<u32> #### type Output = <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u32>> for Wrapping<u32> #### type Output = <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u64>> for &Wrapping<u64> #### type Output = <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u64>> for Wrapping<u64> #### type Output = <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u128>> for &Wrapping<u128> #### type Output = <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<u128>> for Wrapping<u128> #### type Output = <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<usize>> for &Wrapping<usize> #### type Output = <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<&Wrapping<usize>> for Wrapping<usize> #### type Output = <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<bool> for bool #### type Output = bool [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<i8> for i8 #### type Output = i8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<i16> for i16 #### type Output = i16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<i32> for i32 #### type Output = i32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<i64> for i64 #### type Output = i64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<i128> for i128 #### type Output = i128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<isize> for isize #### type Output = isize [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<u8> for u8 #### type Output = u8 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<u16> for u16 #### type Output = u16 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<u32> for u32 #### type Output = u32 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<u64> for u64 #### type Output = u64 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<u128> for u128 #### type Output = u128 [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<usize> for usize #### type Output = usize [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i8>> for Saturating<i8> #### type Output = Saturating<i8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i16>> for Saturating<i16> #### type Output = Saturating<i16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i32>> for Saturating<i32> #### type Output = Saturating<i32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i64>> for Saturating<i64> #### type Output = Saturating<i64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<i128>> for Saturating<i128> #### type Output = Saturating<i128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<isize>> for Saturating<isize> #### type Output = Saturating<isize> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u8>> for Saturating<u8> #### type Output = Saturating<u8> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u16>> for Saturating<u16> #### type Output = Saturating<u16> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u32>> for Saturating<u32> #### type Output = Saturating<u32> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u64>> for Saturating<u64> #### type Output = Saturating<u64> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<u128>> for Saturating<u128> #### type Output = Saturating<u128> [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl BitAnd<Saturating<usize>> for Saturating<usize> #### type Output = Saturating<usize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i8>> for Wrapping<i8> #### type Output = Wrapping<i8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i16>> for Wrapping<i16> #### type Output = Wrapping<i16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i32>> for Wrapping<i32> #### type Output = Wrapping<i32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i64>> for Wrapping<i64> #### type Output = Wrapping<i64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<i128>> for Wrapping<i128> #### type Output = Wrapping<i128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<isize>> for Wrapping<isize> #### type Output = Wrapping<isize> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u8>> for Wrapping<u8> #### type Output = Wrapping<u8> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u16>> for Wrapping<u16> #### type Output = Wrapping<u16> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u32>> for Wrapping<u32> #### type Output = Wrapping<u32> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u64>> for Wrapping<u64> #### type Output = Wrapping<u64> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<u128>> for Wrapping<u128> #### type Output = Wrapping<u128> [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl BitAnd<Wrapping<usize>> for Wrapping<usize> #### type Output = Wrapping<usize> [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<bool> for &'a bool #### type Output = <bool as BitAnd<bool>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<i8> for &'a i8 #### type Output = <i8 as BitAnd<i8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<i16> for &'a i16 #### type Output = <i16 as BitAnd<i16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<i32> for &'a i32 #### type Output = <i32 as BitAnd<i32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<i64> for &'a i64 #### type Output = <i64 as BitAnd<i64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<i128> for &'a i128 #### type Output = <i128 as BitAnd<i128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<isize> for &'a isize #### type Output = <isize as BitAnd<isize>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<u8> for &'a u8 #### type Output = <u8 as BitAnd<u8>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<u16> for &'a u16 #### type Output = <u16 as BitAnd<u16>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<u32> for &'a u32 #### type Output = <u32 as BitAnd<u32>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<u64> for &'a u64 #### type Output = <u64 as BitAnd<u64>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<u128> for &'a u128 #### type Output = <u128 as BitAnd<u128>>::Output [source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · ### impl<'a> BitAnd<usize> for &'a usize #### type Output = <usize as BitAnd<usize>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i8>> for &'a Saturating<i8> #### type Output = <Saturating<i8> as BitAnd<Saturating<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i16>> for &'a Saturating<i16> #### type Output = <Saturating<i16> as BitAnd<Saturating<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i32>> for &'a Saturating<i32> #### type Output = <Saturating<i32> as BitAnd<Saturating<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i64>> for &'a Saturating<i64> #### type Output = <Saturating<i64> as BitAnd<Saturating<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<i128>> for &'a Saturating<i128> #### type Output = <Saturating<i128> as BitAnd<Saturating<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<isize>> for &'a Saturating<isize> #### type Output = <Saturating<isize> as BitAnd<Saturating<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u8>> for &'a Saturating<u8> #### type Output = <Saturating<u8> as BitAnd<Saturating<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u16>> for &'a Saturating<u16> #### type Output = <Saturating<u16> as BitAnd<Saturating<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u32>> for &'a Saturating<u32> #### type Output = <Saturating<u32> as BitAnd<Saturating<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u64>> for &'a Saturating<u64> #### type Output = <Saturating<u64> as BitAnd<Saturating<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<u128>> for &'a Saturating<u128> #### type Output = <Saturating<u128> as BitAnd<Saturating<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#483)### impl<'a> BitAnd<Saturating<usize>> for &'a Saturating<usize> #### type Output = <Saturating<usize> as BitAnd<Saturating<usize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i8>> for &'a Wrapping<i8> #### type Output = <Wrapping<i8> as BitAnd<Wrapping<i8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i16>> for &'a Wrapping<i16> #### type Output = <Wrapping<i16> as BitAnd<Wrapping<i16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i32>> for &'a Wrapping<i32> #### type Output = <Wrapping<i32> as BitAnd<Wrapping<i32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i64>> for &'a Wrapping<i64> #### type Output = <Wrapping<i64> as BitAnd<Wrapping<i64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<i128>> for &'a Wrapping<i128> #### type Output = <Wrapping<i128> as BitAnd<Wrapping<i128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<isize>> for &'a Wrapping<isize> #### type Output = <Wrapping<isize> as BitAnd<Wrapping<isize>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u8>> for &'a Wrapping<u8> #### type Output = <Wrapping<u8> as BitAnd<Wrapping<u8>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u16>> for &'a Wrapping<u16> #### type Output = <Wrapping<u16> as BitAnd<Wrapping<u16>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u32>> for &'a Wrapping<u32> #### type Output = <Wrapping<u32> as BitAnd<Wrapping<u32>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u64>> for &'a Wrapping<u64> #### type Output = <Wrapping<u64> as BitAnd<Wrapping<u64>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<u128>> for &'a Wrapping<u128> #### type Output = <Wrapping<u128> as BitAnd<Wrapping<u128>>>::Output [source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#511)1.14.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl<'a> BitAnd<Wrapping<usize>> for &'a Wrapping<usize> #### type Output = <Wrapping<usize> as BitAnd<Wrapping<usize>>>::Output [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<'lhs, 'rhs, T, const LANES: usize> BitAnd<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](trait.bitand "trait std::ops::BitAnd")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](trait.bitand "trait std::ops::BitAnd")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1429)### impl<T, A> BitAnd<&BTreeSet<T, A>> for &BTreeSet<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Clone](../clone/trait.clone "trait std::clone::Clone"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"), #### type Output = BTreeSet<T, A> [source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1156-1186)### impl<T, S> BitAnd<&HashSet<T, S>> for &HashSet<T, S>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Clone](../clone/trait.clone "trait std::clone::Clone"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher") + [Default](../default/trait.default "trait std::default::Default"), #### type Output = HashSet<T, S> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitAnd<&Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](trait.bitand "trait std::ops::BitAnd")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](trait.bitand "trait std::ops::BitAnd")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#340)### impl<T, const LANES: usize> BitAnd<bool> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#353)### impl<T, const LANES: usize> BitAnd<Mask<T, LANES>> for boolwhere T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#327)### impl<T, const LANES: usize> BitAnd<Mask<T, LANES>> for Mask<T, LANES>where T: [MaskElement](../simd/trait.maskelement "trait std::simd::MaskElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Mask<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops/deref.rs.html#82-124)### impl<T, const LANES: usize> BitAnd<Simd<T, LANES>> for &Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>: [BitAnd](trait.bitand "trait std::ops::BitAnd")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>, [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), <[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES> as [BitAnd](trait.bitand "trait std::ops::BitAnd")<[Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>>>::[Output](trait.bitand#associatedtype.Output "type std::ops::BitAnd::Output") == [Simd](../simd/struct.simd "struct std::simd::Simd")<T, LANES>, #### type Output = Simd<T, LANES> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i8, N>> for Simd<i8, N>where [i8](../primitive.i8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i16, N>> for Simd<i16, N>where [i16](../primitive.i16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i32, N>> for Simd<i32, N>where [i32](../primitive.i32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<i64, N>> for Simd<i64, N>where [i64](../primitive.i64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<i64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<isize, N>> for Simd<isize, N>where [isize](../primitive.isize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<isize, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u8, N>> for Simd<u8, N>where [u8](../primitive.u8): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u8, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u16, N>> for Simd<u16, N>where [u16](../primitive.u16): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u16, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u32, N>> for Simd<u32, N>where [u32](../primitive.u32): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u32, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<u64, N>> for Simd<u64, N>where [u64](../primitive.u64): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<u64, N> [source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/ops.rs.html#168-225)### impl<const N: usize> BitAnd<Simd<usize, N>> for Simd<usize, N>where [usize](../primitive.usize): [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement"), [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<N>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"), #### type Output = Simd<usize, N>
programming_docs
rust Module std::os Module std::os ============== OS-specific functionality. Modules ------- [linux](linux/index "std::os::linux mod")Linux Linux-specific definitions. [raw](raw/index "std::os::raw mod") Compatibility module for C platform-specific types. Use [`core::ffi`](https://doc.rust-lang.org/core/ffi/index.html "core::ffi") instead. [unix](unix/index "std::os::unix mod")Unix Platform-specific extensions to `std` for Unix platforms. [wasi](wasi/index "std::os::wasi mod")WASI Platform-specific extensions to `std` for the WebAssembly System Interface (WASI). [windows](windows/index "std::os::windows mod")Windows Platform-specific extensions to `std` for Windows. rust Module std::os::unix Module std::os::unix ==================== Available on **Unix** only.Platform-specific extensions to `std` for Unix platforms. Provides access to platform-level information on Unix platforms, and exposes Unix-specific functions that would otherwise be inappropriate as part of the core `std` library. It exposes more ways to deal with platform-specific strings ([`OsStr`](../../ffi/struct.osstr), [`OsString`](../../ffi/struct.osstring)), allows to set permissions more granularly, extract low-level file descriptors from files and sockets, and has platform-specific helpers for spawning processes. Examples -------- ``` use std::fs::File; use std::os::unix::prelude::*; fn main() -> std::io::Result<()> { let f = File::create("foo.txt")?; let fd = f.as_raw_fd(); // use fd with native unix bindings Ok(()) } ``` Modules ------- [ucred](ucred/index "std::os::unix::ucred mod")Experimental Unix peer credentials. [ffi](ffi/index "std::os::unix::ffi mod") Unix-specific extensions to primitives in the [`std::ffi`](../../ffi/index) module. [fs](fs/index "std::os::unix::fs mod") Unix-specific extensions to primitives in the [`std::fs`](../../fs/index) module. [io](io/index "std::os::unix::io mod") Unix-specific extensions to general I/O primitives. [net](net/index "std::os::unix::net mod") Unix-specific networking functionality. [prelude](prelude/index "std::os::unix::prelude mod") A prelude for conveniently writing platform-specific code. [process](process/index "std::os::unix::process mod") Unix-specific extensions to primitives in the [`std::process`](../../process/index) module. [raw](raw/index "std::os::unix::raw mod")Deprecated Unix-specific primitives available on all unix platforms. [thread](thread/index "std::os::unix::thread mod") Unix-specific extensions to primitives in the [`std::thread`](../../thread/index) module. rust Struct std::os::unix::net::Messages Struct std::os::unix::net::Messages =================================== ``` pub struct Messages<'a> { /* private fields */ } ``` 🔬This is a nightly-only experimental API. (`unix_socket_ancillary_data` [#76915](https://github.com/rust-lang/rust/issues/76915)) Available on **(Android or Linux) and Unix** only.This struct is used to iterate through the control messages. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#421-452)### impl<'a> Iterator for Messages<'a> #### type Item = Result<AncillaryData<'a>, AncillaryError> The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#424-451)#### fn next(&mut self) -> Option<Self::Item> Advances the iterator and returns the next value. [Read more](../../../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../../../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#215)1.0.0 · #### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../../../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../../../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)1.0.0 · #### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../../../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../../../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)1.0.0 · #### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../../../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../../../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../../../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../../../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../../../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../../../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../../../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../../../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../../../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../../../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../../../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../../../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [Filter](../../../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../../../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../../../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../../../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../../../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../../../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../../../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../../../iter/struct.peekable#method.peek) and [`peek_mut`](../../../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../../../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [SkipWhile](../../../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../../../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../../../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [TakeWhile](../../../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../../../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../../../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../../../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../../../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../../../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../../../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../../../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../../../primitive.reference) St, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../../../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../../../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../../../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../../../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../../../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../../../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../../../option/enum.option#variant.None "None"). [Read more](../../../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../../../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../../../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../../../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../../../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../../../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../../../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../../../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../../../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../../../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../../../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = [()](../../../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../../../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)1.0.0 · #### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../../../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../../../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../../../ops/trait.try "trait std::ops::Try")>::[Residual](../../../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../../../ops/trait.residual "trait std::ops::Residual")<[Option](../../../option/enum.option "enum std::option::Option")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../../../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../../../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../../../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../../../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../../../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = [bool](../../../primitive.bool)>, <R as [Try](../../../ops/trait.try "trait std::ops::Try")>::[Residual](../../../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../../../ops/trait.residual "trait std::ops::Residual")<[Option](../../../option/enum.option "enum std::option::Option")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../../../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../../../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../../../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../../../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../../../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../../../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../../../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../../../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../../../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../../../primitive.reference) T>, Notable traits for [Copied](../../../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../../../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../../../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../../../primitive.reference) T>, Notable traits for [Cloned](../../../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../../../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../../../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../../../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../../../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../../../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../../../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../../../iter/trait.product "trait std::iter::Product")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../../../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another. [Read more](../../../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<[Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../../../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../../../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../../../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../../../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../../../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../../../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../../../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../../../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../../../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../../../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<[Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../../../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../../../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl<'a> RefUnwindSafe for Messages<'a> ### impl<'a> Send for Messages<'a> ### impl<'a> Sync for Messages<'a> ### impl<'a> Unpin for Messages<'a> ### impl<'a> UnwindSafe for Messages<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../../../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../../../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../../../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../../../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../../../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../../../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../../../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../../../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::os::unix::net::SocketAddr Struct std::os::unix::net::SocketAddr ===================================== ``` pub struct SocketAddr { /* private fields */ } ``` Available on **Unix** only.An address associated with a Unix socket. Examples -------- ``` use std::os::unix::net::UnixListener; let socket = match UnixListener::bind("/tmp/sock") { Ok(sock) => sock, Err(e) => { println!("Couldn't bind: {e:?}"); return } }; let addr = socket.local_addr().expect("Couldn't get local address"); ``` Implementations --------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#90-327)### impl SocketAddr [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#149-154)1.61.0 · #### pub fn from\_pathname<P>(path: P) -> Result<SocketAddr>where P: [AsRef](../../../convert/trait.asref "trait std::convert::AsRef")<[Path](../../../path/struct.path "struct std::path::Path")>, Constructs a `SockAddr` with the family `AF_UNIX` and the provided path. ##### Errors Returns an error if the path is longer than `SUN_LEN` or if it contains NULL bytes. ##### Examples ``` use std::os::unix::net::SocketAddr; use std::path::Path; let address = SocketAddr::from_pathname("/path/to/socket")?; assert_eq!(address.as_pathname(), Some(Path::new("/path/to/socket"))); ``` Creating a `SocketAddr` with a NULL byte results in an error. ``` use std::os::unix::net::SocketAddr; assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err()); ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#187-189)#### pub fn is\_unnamed(&self) -> bool Returns `true` if the address is unnamed. ##### Examples A named address: ``` use std::os::unix::net::UnixListener; fn main() -> std::io::Result<()> { let socket = UnixListener::bind("/tmp/sock")?; let addr = socket.local_addr().expect("Couldn't get local address"); assert_eq!(addr.is_unnamed(), false); Ok(()) } ``` An unnamed address: ``` use std::os::unix::net::UnixDatagram; fn main() -> std::io::Result<()> { let socket = UnixDatagram::unbound()?; let addr = socket.local_addr().expect("Couldn't get local address"); assert_eq!(addr.is_unnamed(), true); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#223-225)#### pub fn as\_pathname(&self) -> Option<&Path> Returns the contents of this address if it is a `pathname` address. ##### Examples With a pathname: ``` use std::os::unix::net::UnixListener; use std::path::Path; fn main() -> std::io::Result<()> { let socket = UnixListener::bind("/tmp/sock")?; let addr = socket.local_addr().expect("Couldn't get local address"); assert_eq!(addr.as_pathname(), Some(Path::new("/tmp/sock"))); Ok(()) } ``` Without a pathname: ``` use std::os::unix::net::UnixDatagram; fn main() -> std::io::Result<()> { let socket = UnixDatagram::unbound()?; let addr = socket.local_addr().expect("Couldn't get local address"); assert_eq!(addr.as_pathname(), None); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#248-250)#### pub fn as\_abstract\_namespace(&self) -> Option<&[u8]> 🔬This is a nightly-only experimental API. (`unix_socket_abstract` [#85410](https://github.com/rust-lang/rust/issues/85410)) Available on **Android or Linux** only. Returns the contents of this address if it is an abstract namespace without the leading null byte. ##### Examples ``` #![feature(unix_socket_abstract)] use std::os::unix::net::{UnixListener, SocketAddr}; fn main() -> std::io::Result<()> { let namespace = b"hidden"; let namespace_addr = SocketAddr::from_abstract_namespace(&namespace[..])?; let socket = UnixListener::bind_addr(&namespace_addr)?; let local_addr = socket.local_addr().expect("Couldn't get local address"); assert_eq!(local_addr.as_abstract_namespace(), Some(&namespace[..])); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#306-326)#### pub fn from\_abstract\_namespace(namespace: &[u8]) -> Result<SocketAddr> 🔬This is a nightly-only experimental API. (`unix_socket_abstract` [#85410](https://github.com/rust-lang/rust/issues/85410)) Available on **Android or Linux** only. Creates an abstract domain socket address from a namespace An abstract address does not create a file unlike traditional path-based Unix sockets. The advantage of this is that the address will disappear when the socket bound to it is closed, so no filesystem clean up is required. The leading null byte for the abstract namespace is automatically added. This is a Linux-specific extension. See more at [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html). ##### Errors This will return an error if the given namespace is too long ##### Examples ``` #![feature(unix_socket_abstract)] use std::os::unix::net::{UnixListener, SocketAddr}; fn main() -> std::io::Result<()> { let addr = SocketAddr::from_abstract_namespace(b"hidden")?; let listener = match UnixListener::bind_addr(&addr) { Ok(sock) => sock, Err(err) => { println!("Couldn't bind: {err:?}"); return Err(err); } }; Ok(()) } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#83)### impl Clone for SocketAddr [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#83)#### fn clone(&self) -> SocketAddr Returns a copy of the value. [Read more](../../../clone/trait.clone#tymethod.clone) [source](https://doc.rust-lang.org/src/core/clone.rs.html#132-134)1.0.0 · #### fn clone\_from(&mut self, source: &Self) Performs copy-assignment from `source`. [Read more](../../../clone/trait.clone#method.clone_from) [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#330-338)### impl Debug for SocketAddr [source](https://doc.rust-lang.org/src/std/os/unix/net/addr.rs.html#331-337)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../../../fmt/trait.debug#tymethod.fmt) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for SocketAddr ### impl Send for SocketAddr ### impl Sync for SocketAddr ### impl Unpin for SocketAddr ### impl UnwindSafe for SocketAddr Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../../../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../../../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../../../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../../../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../../../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#83)### impl<T> ToOwned for Twhere T: [Clone](../../../clone/trait.clone "trait std::clone::Clone"), #### type Owned = T The resulting type after obtaining ownership. [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#88)#### fn to\_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. [Read more](../../../borrow/trait.toowned#tymethod.to_owned) [source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#92)#### fn clone\_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. [Read more](../../../borrow/trait.toowned#method.clone_into) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../../../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../../../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion. rust Module std::os::unix::net Module std::os::unix::net ========================= Available on **Unix** only.Unix-specific networking functionality. Re-exports ---------- `pub use ucred::[UCred](../ucred/struct.ucred "struct std::os::unix::ucred::UCred");` Experimental Structs ------- [Messages](struct.messages "std::os::unix::net::Messages struct")ExperimentalAndroid or Linux This struct is used to iterate through the control messages. [ScmCredentials](struct.scmcredentials "std::os::unix::net::ScmCredentials struct")ExperimentalAndroid or Linux This control message contains unix credentials. [ScmRights](struct.scmrights "std::os::unix::net::ScmRights struct")ExperimentalAndroid or Linux This control message contains file descriptors. [SocketAncillary](struct.socketancillary "std::os::unix::net::SocketAncillary struct")ExperimentalAndroid or Linux A Unix socket Ancillary data struct. [SocketCred](struct.socketcred "std::os::unix::net::SocketCred struct")ExperimentalAndroid or Linux Unix credential. [Incoming](struct.incoming "std::os::unix::net::Incoming struct") An iterator over incoming connections to a [`UnixListener`](struct.unixlistener "UnixListener"). [SocketAddr](struct.socketaddr "std::os::unix::net::SocketAddr struct") An address associated with a Unix socket. [UnixDatagram](struct.unixdatagram "std::os::unix::net::UnixDatagram struct") A Unix datagram socket. [UnixListener](struct.unixlistener "std::os::unix::net::UnixListener struct") A structure representing a Unix domain socket server. [UnixStream](struct.unixstream "std::os::unix::net::UnixStream struct") A Unix stream socket. Enums ----- [AncillaryData](enum.ancillarydata "std::os::unix::net::AncillaryData enum")ExperimentalAndroid or Linux This enum represent one control message of variable type. [AncillaryError](enum.ancillaryerror "std::os::unix::net::AncillaryError enum")ExperimentalAndroid or Linux The error type which is returned from parsing the type a control message. rust Struct std::os::unix::net::ScmCredentials Struct std::os::unix::net::ScmCredentials ========================================= ``` pub struct ScmCredentials<'a>(_); ``` 🔬This is a nightly-only experimental API. (`unix_socket_ancillary_data` [#76915](https://github.com/rust-lang/rust/issues/76915)) Available on **(Android or Linux) and Unix** only.This control message contains unix credentials. The level is equal to `SOL_SOCKET` and the type is equal to `SCM_CREDENTIALS` or `SCM_CREDS`. Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#336-342)### impl<'a> Iterator for ScmCredentials<'a> #### type Item = SocketCred The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#339-341)#### fn next(&mut self) -> Option<SocketCred> Advances the iterator and returns the next value. [Read more](../../../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../../../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#215)1.0.0 · #### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../../../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../../../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)1.0.0 · #### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../../../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../../../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)1.0.0 · #### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../../../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../../../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../../../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../../../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../../../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../../../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../../../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../../../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../../../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../../../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../../../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../../../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [Filter](../../../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../../../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../../../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../../../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../../../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../../../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../../../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../../../iter/struct.peekable#method.peek) and [`peek_mut`](../../../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../../../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [SkipWhile](../../../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../../../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../../../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [TakeWhile](../../../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../../../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../../../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../../../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../../../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../../../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../../../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../../../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../../../primitive.reference) St, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../../../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../../../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../../../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../../../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../../../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../../../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../../../option/enum.option#variant.None "None"). [Read more](../../../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../../../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../../../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../../../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../../../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../../../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../../../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../../../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../../../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../../../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../../../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = [()](../../../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../../../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)1.0.0 · #### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../../../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../../../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../../../ops/trait.try "trait std::ops::Try")>::[Residual](../../../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../../../ops/trait.residual "trait std::ops::Residual")<[Option](../../../option/enum.option "enum std::option::Option")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../../../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../../../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../../../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../../../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../../../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = [bool](../../../primitive.bool)>, <R as [Try](../../../ops/trait.try "trait std::ops::Try")>::[Residual](../../../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../../../ops/trait.residual "trait std::ops::Residual")<[Option](../../../option/enum.option "enum std::option::Option")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../../../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../../../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../../../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../../../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../../../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../../../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../../../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../../../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../../../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../../../primitive.reference) T>, Notable traits for [Copied](../../../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../../../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../../../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../../../primitive.reference) T>, Notable traits for [Cloned](../../../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../../../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../../../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../../../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../../../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../../../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../../../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../../../iter/trait.product "trait std::iter::Product")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../../../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another. [Read more](../../../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<[Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../../../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../../../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../../../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../../../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../../../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../../../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../../../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../../../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../../../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../../../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<[Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../../../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../../../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl<'a> RefUnwindSafe for ScmCredentials<'a> ### impl<'a> Send for ScmCredentials<'a> ### impl<'a> Sync for ScmCredentials<'a> ### impl<'a> Unpin for ScmCredentials<'a> ### impl<'a> UnwindSafe for ScmCredentials<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../../../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../../../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../../../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../../../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../../../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../../../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../../../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../../../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::os::unix::net::Incoming Struct std::os::unix::net::Incoming =================================== ``` pub struct Incoming<'a> { /* private fields */ } ``` Available on **Unix** only.An iterator over incoming connections to a [`UnixListener`](struct.unixlistener "UnixListener"). It will never return [`None`](../../../option/enum.option#variant.None "None"). Examples -------- ``` use std::thread; use std::os::unix::net::{UnixStream, UnixListener}; fn handle_client(stream: UnixStream) { // ... } fn main() -> std::io::Result<()> { let listener = UnixListener::bind("/path/to/the/socket")?; for stream in listener.incoming() { match stream { Ok(stream) => { thread::spawn(|| handle_client(stream)); } Err(err) => { break; } } } Ok(()) } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#373)### impl<'a> Debug for Incoming<'a> [source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#373)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../../../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#381-391)### impl<'a> Iterator for Incoming<'a> #### type Item = Result<UnixStream, Error> The type of the elements being iterated over. [source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#384-386)#### fn next(&mut self) -> Option<Result<UnixStream>> Advances the iterator and returns the next value. [Read more](../../../iter/trait.iterator#tymethod.next) [source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#388-390)#### fn size\_hint(&self) -> (usize, Option<usize>) Returns the bounds on the remaining length of the iterator. [Read more](../../../iter/trait.iterator#method.size_hint) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#138-142)#### fn next\_chunk<const N: usize>( &mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> 🔬This is a nightly-only experimental API. (`iter_next_chunk` [#98326](https://github.com/rust-lang/rust/issues/98326)) Advances the iterator and returns an array containing the next `N` values. [Read more](../../../iter/trait.iterator#method.next_chunk) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#252-254)1.0.0 · #### fn count(self) -> usize Consumes the iterator, counting the number of iterations and returning it. [Read more](../../../iter/trait.iterator#method.count) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#282-284)1.0.0 · #### fn last(self) -> Option<Self::Item> Consumes the iterator, returning the last element. [Read more](../../../iter/trait.iterator#method.last) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#328)#### fn advance\_by(&mut self, n: usize) -> Result<(), usize> 🔬This is a nightly-only experimental API. (`iter_advance_by` [#77404](https://github.com/rust-lang/rust/issues/77404)) Advances the iterator by `n` elements. [Read more](../../../iter/trait.iterator#method.advance_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#376)1.0.0 · #### fn nth(&mut self, n: usize) -> Option<Self::Item> Returns the `n`th element of the iterator. [Read more](../../../iter/trait.iterator#method.nth) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)1.28.0 · #### fn step\_by(self, step: usize) -> StepBy<Self> Notable traits for [StepBy](../../../iter/struct.stepby "struct std::iter::StepBy")<I> ``` impl<I> Iterator for StepBy<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator starting at the same point, but stepping by the given amount at each iteration. [Read more](../../../iter/trait.iterator#method.step_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#499-502)1.0.0 · #### fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Notable traits for [Chain](../../../iter/struct.chain "struct std::iter::Chain")<A, B> ``` impl<A, B> Iterator for Chain<A, B>where     A: Iterator,     B: Iterator<Item = <A as Iterator>::Item>, type Item = <A as Iterator>::Item; ``` Takes two iterators and creates a new iterator over both in sequence. [Read more](../../../iter/trait.iterator#method.chain) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#617-620)1.0.0 · #### fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Notable traits for [Zip](../../../iter/struct.zip "struct std::iter::Zip")<A, B> ``` impl<A, B> Iterator for Zip<A, B>where     A: Iterator,     B: Iterator, type Item = (<A as Iterator>::Item, <B as Iterator>::Item); ``` ‘Zips up’ two iterators into a single iterator of pairs. [Read more](../../../iter/trait.iterator#method.zip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#717-720)#### fn intersperse\_with<G>(self, separator: G) -> IntersperseWith<Self, G>where G: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")() -> Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Notable traits for [IntersperseWith](../../../iter/struct.interspersewith "struct std::iter::IntersperseWith")<I, G> ``` impl<I, G> Iterator for IntersperseWith<I, G>where     I: Iterator,     G: FnMut() -> <I as Iterator>::Item, type Item = <I as Iterator>::Item; ``` 🔬This is a nightly-only experimental API. (`iter_intersperse` [#79524](https://github.com/rust-lang/rust/issues/79524)) Creates a new iterator which places an item generated by `separator` between adjacent items of the original iterator. [Read more](../../../iter/trait.iterator#method.intersperse_with) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#776-779)1.0.0 · #### fn map<B, F>(self, f: F) -> Map<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Notable traits for [Map](../../../iter/struct.map "struct std::iter::Map")<I, F> ``` impl<B, I, F> Iterator for Map<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> B, type Item = B; ``` Takes a closure and creates an iterator which calls that closure on each element. [Read more](../../../iter/trait.iterator#method.map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#821-824)1.21.0 · #### fn for\_each<F>(self, f: F)where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Calls a closure on each element of an iterator. [Read more](../../../iter/trait.iterator#method.for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#896-899)1.0.0 · #### fn filter<P>(self, predicate: P) -> Filter<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [Filter](../../../iter/struct.filter "struct std::iter::Filter")<I, P> ``` impl<I, P> Iterator for Filter<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator which uses a closure to determine if an element should be yielded. [Read more](../../../iter/trait.iterator#method.filter) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#941-944)1.0.0 · #### fn filter\_map<B, F>(self, f: F) -> FilterMap<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [FilterMap](../../../iter/struct.filtermap "struct std::iter::FilterMap")<I, F> ``` impl<B, I, F> Iterator for FilterMap<I, F>where     I: Iterator,     F: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both filters and maps. [Read more](../../../iter/trait.iterator#method.filter_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)1.0.0 · #### fn enumerate(self) -> Enumerate<Self> Notable traits for [Enumerate](../../../iter/struct.enumerate "struct std::iter::Enumerate")<I> ``` impl<I> Iterator for Enumerate<I>where     I: Iterator, type Item = (usize, <I as Iterator>::Item); ``` Creates an iterator which gives the current iteration count as well as the next value. [Read more](../../../iter/trait.iterator#method.enumerate) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)1.0.0 · #### fn peekable(self) -> Peekable<Self> Notable traits for [Peekable](../../../iter/struct.peekable "struct std::iter::Peekable")<I> ``` impl<I> Iterator for Peekable<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which can use the [`peek`](../../../iter/struct.peekable#method.peek) and [`peek_mut`](../../../iter/struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information. [Read more](../../../iter/trait.iterator#method.peekable) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1123-1126)1.0.0 · #### fn skip\_while<P>(self, predicate: P) -> SkipWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [SkipWhile](../../../iter/struct.skipwhile "struct std::iter::SkipWhile")<I, P> ``` impl<I, P> Iterator for SkipWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that [`skip`](../../../iter/trait.iterator#method.skip)s elements based on a predicate. [Read more](../../../iter/trait.iterator#method.skip_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1204-1207)1.0.0 · #### fn take\_while<P>(self, predicate: P) -> TakeWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Notable traits for [TakeWhile](../../../iter/struct.takewhile "struct std::iter::TakeWhile")<I, P> ``` impl<I, P> Iterator for TakeWhile<I, P>where     I: Iterator,     P: FnMut(&<I as Iterator>::Item) -> bool, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields elements based on a predicate. [Read more](../../../iter/trait.iterator#method.take_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1292-1295)1.57.0 · #### fn map\_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [MapWhile](../../../iter/struct.mapwhile "struct std::iter::MapWhile")<I, P> ``` impl<B, I, P> Iterator for MapWhile<I, P>where     I: Iterator,     P: FnMut(<I as Iterator>::Item) -> Option<B>, type Item = B; ``` Creates an iterator that both yields elements based on a predicate and maps. [Read more](../../../iter/trait.iterator#method.map_while) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1323-1325)1.0.0 · #### fn skip(self, n: usize) -> Skip<Self> Notable traits for [Skip](../../../iter/struct.skip "struct std::iter::Skip")<I> ``` impl<I> Iterator for Skip<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that skips the first `n` elements. [Read more](../../../iter/trait.iterator#method.skip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1376-1378)1.0.0 · #### fn take(self, n: usize) -> Take<Self> Notable traits for [Take](../../../iter/struct.take "struct std::iter::Take")<I> ``` impl<I> Iterator for Take<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator that yields the first `n` elements, or fewer if the underlying iterator ends sooner. [Read more](../../../iter/trait.iterator#method.take) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1420-1423)1.0.0 · #### fn scan<St, B, F>(self, initial\_state: St, f: F) -> Scan<Self, St, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../../../primitive.reference) St, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Notable traits for [Scan](../../../iter/struct.scan "struct std::iter::Scan")<I, St, F> ``` impl<B, I, St, F> Iterator for Scan<I, St, F>where     I: Iterator,     F: FnMut(&mut St, <I as Iterator>::Item) -> Option<B>, type Item = B; ``` An iterator adapter similar to [`fold`](../../../iter/trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](../../../iter/trait.iterator#method.scan) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1460-1464)1.0.0 · #### fn flat\_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where U: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U, Notable traits for [FlatMap](../../../iter/struct.flatmap "struct std::iter::FlatMap")<I, U, F> ``` impl<I, U, F> Iterator for FlatMap<I, U, F>where     I: Iterator,     U: IntoIterator,     F: FnMut(<I as Iterator>::Item) -> U, type Item = <U as IntoIterator>::Item; ``` Creates an iterator that works like map, but flattens nested structure. [Read more](../../../iter/trait.iterator#method.flat_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)1.0.0 · #### fn fuse(self) -> Fuse<Self> Notable traits for [Fuse](../../../iter/struct.fuse "struct std::iter::Fuse")<I> ``` impl<I> Iterator for Fuse<I>where     I: Iterator, type Item = <I as Iterator>::Item; ``` Creates an iterator which ends after the first [`None`](../../../option/enum.option#variant.None "None"). [Read more](../../../iter/trait.iterator#method.fuse) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1684-1687)1.0.0 · #### fn inspect<F>(self, f: F) -> Inspect<Self, F>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")), Notable traits for [Inspect](../../../iter/struct.inspect "struct std::iter::Inspect")<I, F> ``` impl<I, F> Iterator for Inspect<I, F>where     I: Iterator,     F: FnMut(&<I as Iterator>::Item), type Item = <I as Iterator>::Item; ``` Does something with each element of an iterator, passing the value on. [Read more](../../../iter/trait.iterator#method.inspect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1714-1716)1.0.0 · #### fn by\_ref(&mut self) -> &mut Self Borrows an iterator, rather than consuming it. [Read more](../../../iter/trait.iterator#method.by_ref) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)1.0.0 · #### fn collect<B>(self) -> Bwhere B: [FromIterator](../../../iter/trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Transforms an iterator into a collection. [Read more](../../../iter/trait.iterator#method.collect) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1983-1985)#### fn collect\_into<E>(self, collection: &mut E) -> &mut Ewhere E: [Extend](../../../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, 🔬This is a nightly-only experimental API. (`iter_collect_into` [#94780](https://github.com/rust-lang/rust/issues/94780)) Collects all the items from an iterator into a collection. [Read more](../../../iter/trait.iterator#method.collect_into) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2017-2021)1.0.0 · #### fn partition<B, F>(self, f: F) -> (B, B)where B: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Consumes an iterator, creating two collections from it. [Read more](../../../iter/trait.iterator#method.partition) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2136-2139)#### fn is\_partitioned<P>(self, predicate: P) -> boolwhere P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_is_partitioned` [#62544](https://github.com/rust-lang/rust/issues/62544)) Checks if the elements of this iterator are partitioned according to the given predicate, such that all those that return `true` precede all those that return `false`. [Read more](../../../iter/trait.iterator#method.is_partitioned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2230-2234)1.27.0 · #### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = B>, An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](../../../iter/trait.iterator#method.try_fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2288-2292)1.27.0 · #### fn try\_for\_each<F, R>(&mut self, f: F) -> Rwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = [()](../../../primitive.unit)>, An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. [Read more](../../../iter/trait.iterator#method.try_for_each) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2407-2410)1.0.0 · #### fn fold<B, F>(self, init: B, f: F) -> Bwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(B, Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Folds every element into an accumulator by applying an operation, returning the final result. [Read more](../../../iter/trait.iterator#method.fold) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2453-2456)1.51.0 · #### fn reduce<F>(self, f: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](../../../iter/trait.iterator#method.reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2524-2529)#### fn try\_reduce<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, <R as [Try](../../../ops/trait.try "trait std::ops::Try")>::[Residual](../../../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../../../ops/trait.residual "trait std::ops::Residual")<[Option](../../../option/enum.option "enum std::option::Option")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`iterator_try_reduce` [#87053](https://github.com/rust-lang/rust/issues/87053)) Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. [Read more](../../../iter/trait.iterator#method.try_reduce) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2581-2584)1.0.0 · #### fn all<F>(&mut self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Tests if every element of the iterator matches a predicate. [Read more](../../../iter/trait.iterator#method.all) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2634-2637)1.0.0 · #### fn any<F>(&mut self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Tests if any element of the iterator matches a predicate. [Read more](../../../iter/trait.iterator#method.any) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2694-2697)1.0.0 · #### fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Searches for an element of an iterator that satisfies a predicate. [Read more](../../../iter/trait.iterator#method.find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2725-2728)1.30.0 · #### fn find\_map<B, F>(&mut self, f: F) -> Option<B>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<B>, Applies function to the elements of iterator and returns the first non-none result. [Read more](../../../iter/trait.iterator#method.find_map) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2781-2786)#### fn try\_find<F, R>( &mut self, f: F) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../../../ops/trait.try "trait std::ops::Try")<Output = [bool](../../../primitive.bool)>, <R as [Try](../../../ops/trait.try "trait std::ops::Try")>::[Residual](../../../ops/trait.try#associatedtype.Residual "type std::ops::Try::Residual"): [Residual](../../../ops/trait.residual "trait std::ops::Residual")<[Option](../../../option/enum.option "enum std::option::Option")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>>, 🔬This is a nightly-only experimental API. (`try_find` [#63178](https://github.com/rust-lang/rust/issues/63178)) Applies function to the elements of iterator and returns the first true result or the first error. [Read more](../../../iter/trait.iterator#method.try_find) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2863-2866)1.0.0 · #### fn position<P>(&mut self, predicate: P) -> Option<usize>where P: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../../../primitive.bool), Searches for an element in an iterator, returning its index. [Read more](../../../iter/trait.iterator#method.position) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3031-3034)1.6.0 · #### fn max\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../../../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the maximum value from the specified function. [Read more](../../../iter/trait.iterator#method.max_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3064-3067)1.15.0 · #### fn max\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the maximum value with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.max_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3091-3094)1.6.0 · #### fn min\_by\_key<B, F>(self, f: F) -> Option<Self::Item>where B: [Ord](../../../cmp/trait.ord "trait std::cmp::Ord"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B, Returns the element that gives the minimum value from the specified function. [Read more](../../../iter/trait.iterator#method.min_by_key) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3124-3127)1.15.0 · #### fn min\_by<F>(self, compare: F) -> Option<Self::Item>where F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), Returns the element that gives the minimum value with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.min_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3199-3203)1.0.0 · #### fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../../../default/trait.default "trait std::default::Default") + [Extend](../../../iter/trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../../../primitive.tuple)>, Converts an iterator of pairs into a pair of containers. [Read more](../../../iter/trait.iterator#method.unzip) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3231-3234)1.36.0 · #### fn copied<'a, T>(self) -> Copied<Self>where T: 'a + [Copy](../../../marker/trait.copy "trait std::marker::Copy"), Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../../../primitive.reference) T>, Notable traits for [Copied](../../../iter/struct.copied "struct std::iter::Copied")<I> ``` impl<'a, I, T> Iterator for Copied<I>where     T: 'a + Copy,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which copies all of its elements. [Read more](../../../iter/trait.iterator#method.copied) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3278-3281)1.0.0 · #### fn cloned<'a, T>(self) -> Cloned<Self>where T: 'a + [Clone](../../../clone/trait.clone "trait std::clone::Clone"), Self: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator")<Item = [&'a](../../../primitive.reference) T>, Notable traits for [Cloned](../../../iter/struct.cloned "struct std::iter::Cloned")<I> ``` impl<'a, I, T> Iterator for Cloned<I>where     T: 'a + Clone,     I: Iterator<Item = &'a T>, type Item = T; ``` Creates an iterator which [`clone`](../../../clone/trait.clone#tymethod.clone)s all of its elements. [Read more](../../../iter/trait.iterator#method.cloned) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3355-3357)#### fn array\_chunks<const N: usize>(self) -> ArrayChunks<Self, N> Notable traits for [ArrayChunks](../../../iter/struct.arraychunks "struct std::iter::ArrayChunks")<I, N> ``` impl<I, const N: usize> Iterator for ArrayChunks<I, N>where     I: Iterator, type Item = [<I as Iterator>::Item; N]; ``` 🔬This is a nightly-only experimental API. (`iter_array_chunks` [#100450](https://github.com/rust-lang/rust/issues/100450)) Returns an iterator over `N` elements of the iterator at a time. [Read more](../../../iter/trait.iterator#method.array_chunks) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3385-3388)1.11.0 · #### fn sum<S>(self) -> Swhere S: [Sum](../../../iter/trait.sum "trait std::iter::Sum")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Sums the elements of an iterator. [Read more](../../../iter/trait.iterator#method.sum) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3414-3417)1.11.0 · #### fn product<P>(self) -> Pwhere P: [Product](../../../iter/trait.product "trait std::iter::Product")<Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Iterates over the entire iterator, multiplying all the elements [Read more](../../../iter/trait.iterator#method.product) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3464-3468)#### fn cmp\_by<I, F>(self, other: I, cmp: F) -> Orderingwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering"), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3511-3515)1.5.0 · #### fn partial\_cmp<I>(self, other: I) -> Option<Ordering>where I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another. [Read more](../../../iter/trait.iterator#method.partial_cmp) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3549-3553)#### fn partial\_cmp\_by<I, F>(self, other: I, partial\_cmp: F) -> Option<Ordering>where I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<[Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) [Lexicographically](../../../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](../../../iter/trait.iterator#method.partial_cmp_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3591-3595)1.5.0 · #### fn eq<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../../../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are equal to those of another. [Read more](../../../iter/trait.iterator#method.eq) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3616-3620)#### fn eq\_by<I, F>(self, other: I, eq: F) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")) -> [bool](../../../primitive.bool), 🔬This is a nightly-only experimental API. (`iter_order_by` [#64295](https://github.com/rust-lang/rust/issues/64295)) Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](../../../iter/trait.iterator#method.eq_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3651-3655)1.5.0 · #### fn ne<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../../../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are unequal to those of another. [Read more](../../../iter/trait.iterator#method.ne) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3672-3676)1.5.0 · #### fn lt<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](../../../iter/trait.iterator#method.lt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3693-3697)1.5.0 · #### fn le<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](../../../iter/trait.iterator#method.le) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3714-3718)1.5.0 · #### fn gt<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](../../../iter/trait.iterator#method.gt) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3735-3739)1.5.0 · #### fn ge<I>(self, other: I) -> boolwhere I: [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](../../../iter/trait.intoiterator "trait std::iter::IntoIterator")>::[Item](../../../iter/trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>, Determines if the elements of this [`Iterator`](../../../iter/trait.iterator "Iterator") are [lexicographically](../../../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](../../../iter/trait.iterator#method.ge) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3794-3797)#### fn is\_sorted\_by<F>(self, compare: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../../../option/enum.option "enum std::option::Option")<[Ordering](../../../cmp/enum.ordering "enum std::cmp::Ordering")>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given comparator function. [Read more](../../../iter/trait.iterator#method.is_sorted_by) [source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3840-3844)#### fn is\_sorted\_by\_key<F, K>(self, f: F) -> boolwhere F: [FnMut](../../../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](../../../iter/trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> K, K: [PartialOrd](../../../cmp/trait.partialord "trait std::cmp::PartialOrd")<K>, 🔬This is a nightly-only experimental API. (`is_sorted` [#53485](https://github.com/rust-lang/rust/issues/53485)) Checks if the elements of this iterator are sorted using the given key extraction function. [Read more](../../../iter/trait.iterator#method.is_sorted_by_key) Auto Trait Implementations -------------------------- ### impl<'a> RefUnwindSafe for Incoming<'a> ### impl<'a> Send for Incoming<'a> ### impl<'a> Sync for Incoming<'a> ### impl<'a> Unpin for Incoming<'a> ### impl<'a> UnwindSafe for Incoming<'a> Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../../../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../../../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../../../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../../../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../../../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)### impl<I> IntoIterator for Iwhere I: [Iterator](../../../iter/trait.iterator "trait std::iter::Iterator"), #### type Item = <I as Iterator>::Item The type of the elements being iterated over. #### type IntoIter = I Which kind of iterator are we turning this into? [source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · #### fn into\_iter(self) -> I Creates an iterator from a value. [Read more](../../../iter/trait.intoiterator#tymethod.into_iter) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../../../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../../../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs
rust Struct std::os::unix::net::UnixStream Struct std::os::unix::net::UnixStream ===================================== ``` pub struct UnixStream(_); ``` Available on **Unix** only.A Unix stream socket. Examples -------- ``` use std::os::unix::net::UnixStream; use std::io::prelude::*; fn main() -> std::io::Result<()> { let mut stream = UnixStream::connect("/path/to/my/socket")?; stream.write_all(b"hello world")?; let mut response = String::new(); stream.read_to_string(&mut response)?; println!("{response}"); Ok(()) } ``` Implementations --------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#75-616)### impl UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#92-100)#### pub fn connect<P: AsRef<Path>>(path: P) -> Result<UnixStream> Connects to the socket named by `path`. ##### Examples ``` use std::os::unix::net::UnixStream; let socket = match UnixStream::connect("/tmp/sock") { Ok(sock) => sock, Err(e) => { println!("Couldn't connect: {e:?}"); return } }; ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#127-137)#### pub fn connect\_addr(socket\_addr: &SocketAddr) -> Result<UnixStream> 🔬This is a nightly-only experimental API. (`unix_socket_abstract` [#85410](https://github.com/rust-lang/rust/issues/85410)) Connects to the socket specified by [`address`](struct.socketaddr). ##### Examples ``` #![feature(unix_socket_abstract)] use std::os::unix::net::{UnixListener, UnixStream}; fn main() -> std::io::Result<()> { let listener = UnixListener::bind("/path/to/the/socket")?; let addr = listener.local_addr()?; let sock = match UnixStream::connect_addr(&addr) { Ok(sock) => sock, Err(e) => { println!("Couldn't connect: {e:?}"); return Err(e) } }; Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#157-160)#### pub fn pair() -> Result<(UnixStream, UnixStream)> Creates an unnamed pair of connected sockets. Returns two `UnixStream`s which are connected to each other. ##### Examples ``` use std::os::unix::net::UnixStream; let (sock1, sock2) = match UnixStream::pair() { Ok((sock1, sock2)) => (sock1, sock2), Err(e) => { println!("Couldn't create a pair of sockets: {e:?}"); return } }; ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#181-183)#### pub fn try\_clone(&self) -> Result<UnixStream> Creates a new independently owned handle to the underlying socket. The returned `UnixStream` is a reference to the same stream that this object references. Both handles will read and write the same stream of data, and options set on one stream will be propagated to the other stream. ##### Examples ``` use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let sock_copy = socket.try_clone().expect("Couldn't clone socket"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#199-201)#### pub fn local\_addr(&self) -> Result<SocketAddr> Returns the socket address of the local half of this connection. ##### Examples ``` use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let addr = socket.local_addr().expect("Couldn't get local address"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#217-219)#### pub fn peer\_addr(&self) -> Result<SocketAddr> Returns the socket address of the remote half of this connection. ##### Examples ``` use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let addr = socket.peer_addr().expect("Couldn't get peer address"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#247-249)#### pub fn peer\_cred(&self) -> Result<UCred> 🔬This is a nightly-only experimental API. (`peer_credentials_unix_socket` [#42839](https://github.com/rust-lang/rust/issues/42839)) Gets the peer credentials for this Unix domain socket. ##### Examples ``` #![feature(peer_credentials_unix_socket)] use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let peer_cred = socket.peer_cred().expect("Couldn't get peer credentials"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#289-291)#### pub fn set\_read\_timeout(&self, timeout: Option<Duration>) -> Result<()> Sets the read timeout for the socket. If the provided value is [`None`](../../../option/enum.option#variant.None "None"), then [`read`](../../../io/trait.read#tymethod.read) calls will block indefinitely. An [`Err`](../../../result/enum.result#variant.Err "Err") is returned if the zero [`Duration`](../../../time/struct.duration "Duration") is passed to this method. ##### Examples ``` use std::os::unix::net::UnixStream; use std::time::Duration; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout"); Ok(()) } ``` An [`Err`](../../../result/enum.result#variant.Err "Err") is returned if the zero [`Duration`](../../../time/struct.duration "Duration") is passed to this method: ``` use std::io; use std::os::unix::net::UnixStream; use std::time::Duration; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let result = socket.set_read_timeout(Some(Duration::new(0, 0))); let err = result.unwrap_err(); assert_eq!(err.kind(), io::ErrorKind::InvalidInput); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#332-334)#### pub fn set\_write\_timeout(&self, timeout: Option<Duration>) -> Result<()> Sets the write timeout for the socket. If the provided value is [`None`](../../../option/enum.option#variant.None "None"), then [`write`](../../../macro.write "write") calls will block indefinitely. An [`Err`](../../../result/enum.result#variant.Err "Err") is returned if the zero [`Duration`](../../../time/struct.duration "Duration") is passed to this method. ##### Examples ``` use std::os::unix::net::UnixStream; use std::time::Duration; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.set_write_timeout(Some(Duration::new(1, 0))) .expect("Couldn't set write timeout"); Ok(()) } ``` An [`Err`](../../../result/enum.result#variant.Err "Err") is returned if the zero [`Duration`](../../../time/struct.duration "Duration") is passed to this method: ``` use std::io; use std::net::UdpSocket; use std::time::Duration; fn main() -> std::io::Result<()> { let socket = UdpSocket::bind("127.0.0.1:34254")?; let result = socket.set_write_timeout(Some(Duration::new(0, 0))); let err = result.unwrap_err(); assert_eq!(err.kind(), io::ErrorKind::InvalidInput); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#352-354)#### pub fn read\_timeout(&self) -> Result<Option<Duration>> Returns the read timeout of this socket. ##### Examples ``` use std::os::unix::net::UnixStream; use std::time::Duration; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout"); assert_eq!(socket.read_timeout()?, Some(Duration::new(1, 0))); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#373-375)#### pub fn write\_timeout(&self) -> Result<Option<Duration>> Returns the write timeout of this socket. ##### Examples ``` use std::os::unix::net::UnixStream; use std::time::Duration; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.set_write_timeout(Some(Duration::new(1, 0))) .expect("Couldn't set write timeout"); assert_eq!(socket.write_timeout()?, Some(Duration::new(1, 0))); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#391-393)#### pub fn set\_nonblocking(&self, nonblocking: bool) -> Result<()> Moves the socket into or out of nonblocking mode. ##### Examples ``` use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.set_nonblocking(true).expect("Couldn't set nonblocking"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#414-416)#### pub fn set\_passcred(&self, passcred: bool) -> Result<()> 🔬This is a nightly-only experimental API. (`unix_socket_ancillary_data` [#76915](https://github.com/rust-lang/rust/issues/76915)) Moves the socket to pass unix credentials as control message in [`SocketAncillary`](struct.socketancillary "SocketAncillary"). Set the socket option `SO_PASSCRED`. ##### Examples ``` #![feature(unix_socket_ancillary_data)] use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.set_passcred(true).expect("Couldn't set passcred"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#426-428)#### pub fn passcred(&self) -> Result<bool> 🔬This is a nightly-only experimental API. (`unix_socket_ancillary_data` [#76915](https://github.com/rust-lang/rust/issues/76915)) Get the current value of the socket for passing unix credentials in [`SocketAncillary`](struct.socketancillary "SocketAncillary"). This value can be change by [`set_passcred`](struct.unixstream#method.set_passcred). Get the socket option `SO_PASSCRED`. [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#451-453)#### pub fn set\_mark(&self, mark: u32) -> Result<()> 🔬This is a nightly-only experimental API. (`unix_set_mark` [#96467](https://github.com/rust-lang/rust/issues/96467)) Set the id of the socket for network filtering purpose ``` #![feature(unix_set_mark)] use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let sock = UnixStream::connect("/tmp/sock")?; sock.set_mark(32)?; Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#474-476)#### pub fn take\_error(&self) -> Result<Option<Error>> Returns the value of the `SO_ERROR` option. ##### Examples ``` use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; if let Ok(Some(err)) = socket.take_error() { println!("Got error: {err:?}"); } Ok(()) } ``` ##### Platform specific On Redox this always returns `None`. [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#497-499)#### pub fn shutdown(&self, how: Shutdown) -> Result<()> Shuts down the read, write, or both halves of this connection. This function will cause all pending and future I/O calls on the specified portions to immediately return with an appropriate value (see the documentation of [`Shutdown`](../../../net/enum.shutdown "Shutdown")). ##### Examples ``` use std::os::unix::net::UnixStream; use std::net::Shutdown; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; socket.shutdown(Shutdown::Both).expect("shutdown function failed"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#523-525)#### pub fn peek(&self, buf: &mut [u8]) -> Result<usize> 🔬This is a nightly-only experimental API. (`unix_socket_peek` [#76923](https://github.com/rust-lang/rust/issues/76923)) Receives data on the socket from the remote address to which it is connected, without removing that data from the queue. On success, returns the number of bytes peeked. Successive calls return the same data. This is accomplished by passing `MSG_PEEK` as a flag to the underlying `recv` system call. ##### Examples ``` #![feature(unix_socket_peek)] use std::os::unix::net::UnixStream; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let mut buf = [0; 10]; let len = socket.peek(&mut buf).expect("peek failed"); Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#566-574)#### pub fn recv\_vectored\_with\_ancillary( &self, bufs: &mut [IoSliceMut<'\_>], ancillary: &mut SocketAncillary<'\_>) -> Result<usize> 🔬This is a nightly-only experimental API. (`unix_socket_ancillary_data` [#76915](https://github.com/rust-lang/rust/issues/76915)) Receives data and ancillary data from socket. On success, returns the number of bytes read. ##### Examples ``` #![feature(unix_socket_ancillary_data)] use std::os::unix::net::{UnixStream, SocketAncillary, AncillaryData}; use std::io::IoSliceMut; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let mut buf1 = [1; 8]; let mut buf2 = [2; 16]; let mut buf3 = [3; 8]; let mut bufs = &mut [ IoSliceMut::new(&mut buf1), IoSliceMut::new(&mut buf2), IoSliceMut::new(&mut buf3), ][..]; let mut fds = [0; 8]; let mut ancillary_buffer = [0; 128]; let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]); let size = socket.recv_vectored_with_ancillary(bufs, &mut ancillary)?; println!("received {size}"); for ancillary_result in ancillary.messages() { if let AncillaryData::ScmRights(scm_rights) = ancillary_result.unwrap() { for fd in scm_rights { println!("receive file descriptor: {fd}"); } } } Ok(()) } ``` [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#609-615)#### pub fn send\_vectored\_with\_ancillary( &self, bufs: &[IoSlice<'\_>], ancillary: &mut SocketAncillary<'\_>) -> Result<usize> 🔬This is a nightly-only experimental API. (`unix_socket_ancillary_data` [#76915](https://github.com/rust-lang/rust/issues/76915)) Sends data and ancillary data on the socket. On success, returns the number of bytes written. ##### Examples ``` #![feature(unix_socket_ancillary_data)] use std::os::unix::net::{UnixStream, SocketAncillary}; use std::io::IoSlice; fn main() -> std::io::Result<()> { let socket = UnixStream::connect("/tmp/sock")?; let buf1 = [1; 8]; let buf2 = [2; 16]; let buf3 = [3; 8]; let bufs = &[ IoSlice::new(&buf1), IoSlice::new(&buf2), IoSlice::new(&buf3), ][..]; let fds = [0, 1, 2]; let mut ancillary_buffer = [0; 128]; let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]); ancillary.add_fds(&fds[..]); socket.send_vectored_with_ancillary(bufs, &mut ancillary) .expect("send_vectored_with_ancillary function failed"); Ok(()) } ``` Trait Implementations --------------------- [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#715-720)1.63.0 · ### impl AsFd for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#717-719)#### fn as\_fd(&self) -> BorrowedFd<'\_> Borrows the file descriptor. [Read more](../io/trait.asfd#tymethod.as_fd) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#691-696)### impl AsRawFd for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#693-695)#### fn as\_raw\_fd(&self) -> RawFd Extracts the raw file descriptor. [Read more](../io/trait.asrawfd#tymethod.as_raw_fd) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#61-73)### impl Debug for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#62-72)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result Formats the value using the given formatter. [Read more](../../../fmt/trait.debug#tymethod.fmt) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#731-736)1.63.0 · ### impl From<OwnedFd> for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#733-735)#### fn from(owned: OwnedFd) -> Self Converts to this type from the input type. [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#723-728)1.63.0 · ### impl From<UnixStream> for OwnedFd [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#725-727)#### fn from(unix\_stream: UnixStream) -> OwnedFd Converts to this type from the input type. [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#699-704)### impl FromRawFd for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#701-703)#### unsafe fn from\_raw\_fd(fd: RawFd) -> UnixStream Notable traits for [UnixStream](struct.unixstream "struct std::os::unix::net::UnixStream") ``` impl Read for UnixStream impl<'a> Read for &'a UnixStream impl Write for UnixStream impl<'a> Write for &'a UnixStream ``` Constructs a new instance of `Self` from the given raw file descriptor. [Read more](../io/trait.fromrawfd#tymethod.from_raw_fd) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#707-712)### impl IntoRawFd for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#709-711)#### fn into\_raw\_fd(self) -> RawFd Consumes this object, returning the raw underlying file descriptor. [Read more](../io/trait.intorawfd#tymethod.into_raw_fd) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#635-648)### impl<'a> Read for &'a UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#636-638)#### fn read(&mut self, buf: &mut [u8]) -> Result<usize> Pull some bytes from this source into the specified buffer, returning how many bytes were read. [Read more](../../../io/trait.read#tymethod.read) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#640-642)#### fn read\_vectored(&mut self, bufs: &mut [IoSliceMut<'\_>]) -> Result<usize> Like `read`, except that it reads into a slice of buffers. [Read more](../../../io/trait.read#method.read_vectored) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#645-647)#### fn is\_read\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Read`er has an efficient `read_vectored` implementation. [Read more](../../../io/trait.read#method.is_read_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#706-708)1.0.0 · #### fn read\_to\_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> Read all bytes until EOF in this source, placing them into `buf`. [Read more](../../../io/trait.read#method.read_to_end) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#749-751)1.0.0 · #### fn read\_to\_string(&mut self, buf: &mut String) -> Result<usize> Read all bytes until EOF in this source, appending them to `buf`. [Read more](../../../io/trait.read#method.read_to_string) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#804-806)1.6.0 · #### fn read\_exact(&mut self, buf: &mut [u8]) -> Result<()> Read the exact number of bytes required to fill `buf`. [Read more](../../../io/trait.read#method.read_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#815-817)#### fn read\_buf(&mut self, buf: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Pull some bytes from this source into the specified buffer. [Read more](../../../io/trait.read#method.read_buf) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#824-839)#### fn read\_buf\_exact(&mut self, cursor: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Read the exact number of bytes required to fill `cursor`. [Read more](../../../io/trait.read#method.read_buf_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#876-881)1.0.0 · #### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adaptor for this instance of `Read`. [Read more](../../../io/trait.read#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#919-924)1.0.0 · #### fn bytes(self) -> Bytes<Self>where Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Bytes](../../../io/struct.bytes "struct std::io::Bytes")<R> ``` impl<R: Read> Iterator for Bytes<R> type Item = Result<u8>; ``` Transforms this `Read` instance to an [`Iterator`](../../../iter/trait.iterator "Iterator") over its bytes. [Read more](../../../io/trait.read#method.bytes) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#957-962)1.0.0 · #### fn chain<R: Read>(self, next: R) -> Chain<Self, R>where Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Chain](../../../io/struct.chain "struct std::io::Chain")<T, U> ``` impl<T: Read, U: Read> Read for Chain<T, U> ``` Creates an adapter which will chain this stream with another. [Read more](../../../io/trait.read#method.chain) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#996-1001)1.0.0 · #### fn take(self, limit: u64) -> Take<Self>where Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Take](../../../io/struct.take "struct std::io::Take")<T> ``` impl<T: Read> Read for Take<T> ``` Creates an adapter which will read at most `limit` bytes from it. [Read more](../../../io/trait.read#method.take) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#619-632)### impl Read for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#620-622)#### fn read(&mut self, buf: &mut [u8]) -> Result<usize> Pull some bytes from this source into the specified buffer, returning how many bytes were read. [Read more](../../../io/trait.read#tymethod.read) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#624-626)#### fn read\_vectored(&mut self, bufs: &mut [IoSliceMut<'\_>]) -> Result<usize> Like `read`, except that it reads into a slice of buffers. [Read more](../../../io/trait.read#method.read_vectored) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#629-631)#### fn is\_read\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Read`er has an efficient `read_vectored` implementation. [Read more](../../../io/trait.read#method.is_read_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#706-708)1.0.0 · #### fn read\_to\_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> Read all bytes until EOF in this source, placing them into `buf`. [Read more](../../../io/trait.read#method.read_to_end) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#749-751)1.0.0 · #### fn read\_to\_string(&mut self, buf: &mut String) -> Result<usize> Read all bytes until EOF in this source, appending them to `buf`. [Read more](../../../io/trait.read#method.read_to_string) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#804-806)1.6.0 · #### fn read\_exact(&mut self, buf: &mut [u8]) -> Result<()> Read the exact number of bytes required to fill `buf`. [Read more](../../../io/trait.read#method.read_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#815-817)#### fn read\_buf(&mut self, buf: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Pull some bytes from this source into the specified buffer. [Read more](../../../io/trait.read#method.read_buf) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#824-839)#### fn read\_buf\_exact(&mut self, cursor: BorrowedCursor<'\_>) -> Result<()> 🔬This is a nightly-only experimental API. (`read_buf` [#78485](https://github.com/rust-lang/rust/issues/78485)) Read the exact number of bytes required to fill `cursor`. [Read more](../../../io/trait.read#method.read_buf_exact) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#876-881)1.0.0 · #### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adaptor for this instance of `Read`. [Read more](../../../io/trait.read#method.by_ref) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#919-924)1.0.0 · #### fn bytes(self) -> Bytes<Self>where Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Bytes](../../../io/struct.bytes "struct std::io::Bytes")<R> ``` impl<R: Read> Iterator for Bytes<R> type Item = Result<u8>; ``` Transforms this `Read` instance to an [`Iterator`](../../../iter/trait.iterator "Iterator") over its bytes. [Read more](../../../io/trait.read#method.bytes) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#957-962)1.0.0 · #### fn chain<R: Read>(self, next: R) -> Chain<Self, R>where Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Chain](../../../io/struct.chain "struct std::io::Chain")<T, U> ``` impl<T: Read, U: Read> Read for Chain<T, U> ``` Creates an adapter which will chain this stream with another. [Read more](../../../io/trait.read#method.chain) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#996-1001)1.0.0 · #### fn take(self, limit: u64) -> Take<Self>where Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Notable traits for [Take](../../../io/struct.take "struct std::io::Take")<T> ``` impl<T: Read> Read for Take<T> ``` Creates an adapter which will read at most `limit` bytes from it. [Read more](../../../io/trait.read#method.take) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#671-688)### impl<'a> Write for &'a UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#672-674)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](../../../io/trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#676-678)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](../../../io/trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](../../../io/trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#681-683)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](../../../io/trait.write#method.write_vectored) implementation. [Read more](../../../io/trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#685-687)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](../../../io/trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)1.0.0 · #### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](../../../io/trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](../../../io/trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)1.0.0 · #### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](../../../io/trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)1.0.0 · #### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](../../../io/trait.write#method.by_ref) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#651-668)### impl Write for UnixStream [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#652-654)#### fn write(&mut self, buf: &[u8]) -> Result<usize> Write a buffer into this writer, returning how many bytes were written. [Read more](../../../io/trait.write#tymethod.write) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#656-658)#### fn write\_vectored(&mut self, bufs: &[IoSlice<'\_>]) -> Result<usize> Like [`write`](../../../io/trait.write#tymethod.write), except that it writes from a slice of buffers. [Read more](../../../io/trait.write#method.write_vectored) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#661-663)#### fn is\_write\_vectored(&self) -> bool 🔬This is a nightly-only experimental API. (`can_vector` [#69941](https://github.com/rust-lang/rust/issues/69941)) Determines if this `Write`r has an efficient [`write_vectored`](../../../io/trait.write#method.write_vectored) implementation. [Read more](../../../io/trait.write#method.is_write_vectored) [source](https://doc.rust-lang.org/src/std/os/unix/net/stream.rs.html#665-667)#### fn flush(&mut self) -> Result<()> Flush this output stream, ensuring that all intermediately buffered contents reach their destination. [Read more](../../../io/trait.write#tymethod.flush) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1537-1552)1.0.0 · #### fn write\_all(&mut self, buf: &[u8]) -> Result<()> Attempts to write an entire buffer into this writer. [Read more](../../../io/trait.write#method.write_all) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1602-1620)#### fn write\_all\_vectored(&mut self, bufs: &mut [IoSlice<'\_>]) -> Result<()> 🔬This is a nightly-only experimental API. (`write_all_vectored` [#70436](https://github.com/rust-lang/rust/issues/70436)) Attempts to write multiple buffers into this writer. [Read more](../../../io/trait.write#method.write_all_vectored) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1658-1690)1.0.0 · #### fn write\_fmt(&mut self, fmt: Arguments<'\_>) -> Result<()> Writes a formatted string into this writer, returning any error encountered. [Read more](../../../io/trait.write#method.write_fmt) [source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1714-1719)1.0.0 · #### fn by\_ref(&mut self) -> &mut Selfwhere Self: [Sized](../../../marker/trait.sized "trait std::marker::Sized"), Creates a “by reference” adapter for this instance of `Write`. [Read more](../../../io/trait.write#method.by_ref) Auto Trait Implementations -------------------------- ### impl RefUnwindSafe for UnixStream ### impl Send for UnixStream ### impl Sync for UnixStream ### impl Unpin for UnixStream ### impl UnwindSafe for UnixStream Blanket Implementations ----------------------- [source](https://doc.rust-lang.org/src/core/any.rs.html#200)### impl<T> Any for Twhere T: 'static + ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/any.rs.html#201)#### fn type\_id(&self) -> TypeId Gets the `TypeId` of `self`. [Read more](../../../any/trait.any#tymethod.type_id) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#209)### impl<T> Borrow<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#211)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow(&self) -> &T Immutably borrows from an owned value. [Read more](../../../borrow/trait.borrow#tymethod.borrow) [source](https://doc.rust-lang.org/src/core/borrow.rs.html#218)### impl<T> BorrowMut<T> for Twhere T: ?[Sized](../../../marker/trait.sized "trait std::marker::Sized"), [source](https://doc.rust-lang.org/src/core/borrow.rs.html#219)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### fn borrow\_mut(&mut self) -> &mut T Mutably borrows from an owned value. [Read more](../../../borrow/trait.borrowmut#tymethod.borrow_mut) [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#559)### impl<T> From<T> for T [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#562)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(t: T) -> T Returns the argument unchanged. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#543)### impl<T, U> Into<U> for Twhere U: [From](../../../convert/trait.from "trait std::convert::From")<T>, [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#551)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `[From](../../../convert/trait.from "From")<T> for U` chooses to do. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#601)### impl<T, U> TryFrom<U> for Twhere U: [Into](../../../convert/trait.into "trait std::convert::Into")<T>, #### type Error = Infallible The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#607)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> Performs the conversion. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#586)### impl<T, U> TryInto<U> for Twhere U: [TryFrom](../../../convert/trait.tryfrom "trait std::convert::TryFrom")<T>, #### type Error = <U as TryFrom<T>>::Error The type returned in the event of a conversion error. [source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#592)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn try\_into(self) -> Result<U, <U as TryFrom<T>>::Error> Performs the conversion.
programming_docs